lk******@geocities.com (lawrence) wrote in message news:<da**************************@posting.google. com>...
I wrote some code that let me upload a file to my server. Then I wrote
some code to let me delete the file. But when I try to delete, I get
this error:
Warning: Unlink failed (Permission denied) in
/usr/local/www/vhosts/publicdomainsoftware.org/htdocs/ppUtilityCode/mcAdminImages.php
on line 254
I don't get it. If PHP uploads the file, how can PHP not have the
permission to delete it?
If the file name you uploaded already existed on the web server and
the web server user (apache?) has write permissions to the file, it
will be allowed.
To unlink, the web server user must have write permissions to the
directory.
Conversely, if a user has write permissions to a directory, it may
delete files from that directory regardless of who owns them...
Hope this helps,
Kevin