Skip to main content
Inspiring
September 5, 2006
Question

OT: PHP unlink()

  • September 5, 2006
  • 26 replies
  • 1411 views
As discussed on the PHP.Net site, I am throwing a permission denied error -

Warning: unlink(../images/users/Murray/Creek.jpg) [function.unlink]:
Permission denied in
W:\Webspace\resadmin\madison\madisonconcrete.com\www\manage\m_users_update.php
on line 82


when I try to delete an image file from a folder with this markup -

unlink('../images/users/'.$userName."/".$_POST['images']);

There are several vague workarounds there that I'm not sure I fully
followed. One of them says to make an ftp connection and then use ftp
delete to wipe the file. Is this the best way?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================



This topic has been closed for replies.

26 replies

Inspiring
September 7, 2006
I have not used that one. Luckily, my host resolved the permissions
problem....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"John Doe" <jdoe_ns@telefonica.net> wrote in message
news:edopaj$lgk$1@forums.macromedia.com...
> hi:
>
> have somebody used a utility named chmod Win? i had a similar problem as
> Murray some months ago and a friend told me about it. finally, and
> luckily, i persuaded the client to move from the Windows plan to a Linux
> one so i didn't play with it
>
> David Powers wrote:
>> Murray *ACE* wrote:
>>
>>> It appears that permissions are being set at 666 when I upload the file.
>>
>>
>> Not on a Windows server, they're not. Windows uses a different set of
>> permissions. If you were on a *nix server you might be able to use
>> umask() to set the permissions of an uploaded image, but I don't know of
>> any way to do it with Windows and PHP.
>>


Inspiring
September 7, 2006
hi:

have somebody used a utility named chmod Win? i had a similar problem as
Murray some months ago and a friend told me about it. finally, and
luckily, i persuaded the client to move from the Windows plan to a Linux
one so i didn't play with it

David Powers wrote:
> Murray *ACE* wrote:
>
>> It appears that permissions are being set at 666 when I upload the file.
>
>
> Not on a Windows server, they're not. Windows uses a different set of
> permissions. If you were on a *nix server you might be able to use
> umask() to set the permissions of an uploaded image, but I don't know of
> any way to do it with Windows and PHP.
>
Inspiring
September 5, 2006
Mine works locally. It's the server. <sigh>

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"David Powers" <david@example.com> wrote in message
news:edkv4q$4as$1@forums.macromedia.com...
> Murray *ACE* wrote:
>> You are using my script. If it works locally for you, it'll work locally
>> for me! 8)
>
> I'm not using your script. I'm using one that I wrote myself and have
> verified that it works.
>
> --
> David Powers
> Adobe Community Expert
> Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
> http://foundationphp.com/


Inspiring
September 5, 2006
Murray *ACE* wrote:
> You are using my script. If it works locally for you, it'll work locally
> for me! 8)

I'm not using your script. I'm using one that I wrote myself and have
verified that it works.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Inspiring
September 5, 2006
You are using my script. If it works locally for you, it'll work locally
for me! 8)

It's the damn server I'm worried about!

But I'll give it a shove....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"David Powers" <david@example.com> wrote in message
news:edku1e$38k$1@forums.macromedia.com...
> Murray *ACE* wrote:
>>>Obvious question: did you test the script in your local testing
>>>environment?
>>
>> No. Only on the production server.
>
> Well, for goodness sake, test it locally. It took me about five minutes to
> create a local test on Windows. It works perfectly. If your script doesn't
> work locally, it suggests there's something wrong with your code. On the
> other hand, if it works locally, but not on the remote server, it's more
> likely to be a permissions problem.
>
> --
> David Powers
> Adobe Community Expert
> Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
> http://foundationphp.com/


Inspiring
September 5, 2006
Murray *ACE* wrote:
>>Obvious question: did you test the script in your local testing
>>environment?
>
> No. Only on the production server.

Well, for goodness sake, test it locally. It took me about five minutes
to create a local test on Windows. It works perfectly. If your script
doesn't work locally, it suggests there's something wrong with your
code. On the other hand, if it works locally, but not on the remote
server, it's more likely to be a permissions problem.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Inspiring
September 5, 2006
I'm finding archived posts about permissions in IUSR_<machine name> as being
the culprit. Have contacted the host....

By the way - they claim to have NNTP forums, but although I can download the
list of forum names, I cannot connect to any of them....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns98359BE0D5977makowiecatnycapdotrE@216.104.212.96...
> On 05 Sep 2006 in macromedia.dreamweaver.appdev, Joe Makowiec wrote:
>
>> On 05 Sep 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:
>>
>>> Duh - makes sense.
>>
>> Yeah. They also have linked newsgroups.
>
> ... with what looks like huge retention. Your q&a may already be there.
>
> --
> Joe Makowiec
> http://makowiec.net/
> Email: http://makowiec.net/email.php


Inspiring
September 5, 2006
On 05 Sep 2006 in macromedia.dreamweaver.appdev, Joe Makowiec wrote:

> On 05 Sep 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:
>
>> Duh - makes sense.
>
> Yeah. They also have linked newsgroups.

... with what looks like huge retention. Your q&a may already be there.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
Inspiring
September 5, 2006
On 05 Sep 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:

> Duh - makes sense.

Yeah. They also have linked newsgroups.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
Inspiring
September 5, 2006
Duh - makes sense.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns983599360C489makowiecatnycapdotrE@216.104.212.96...
> On 05 Sep 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:
>
>>> You could try the PHP-general mailing list. It's frequented by some
>>> of the guys who write the core code for PHP.
>>
>> Where is that, David?
>
> http://www.php.net/mailing-lists.php
>
> --
> Joe Makowiec
> http://makowiec.net/
> Email: http://makowiec.net/email.php