Yet another PHP problem (permissions)
Date: 12/09/05
(WebDesign) Keywords: php, html
So I'm slowly working on a script to automate displaying galleries. I've got everything to work except one little thing:
Basically, in the script, a person creates a directory and uploads their files via FTP. Once this is done they run one of my scripts, which copies the pictures to another directory, after resizing, watermarking, etc. All the part works fine.
The problem is the script cannot delete the original files once the copying has been done. The problems looks like ownership permissions. I noticed that when the script creates the other directory and files the owner is set to 'nobody'. But when I try to delete the fiels that were uploaded (either by unlink or by using exec() to run del) I get the following error:
Warning: unlink(admin/upload/viking/060F0835_RT8.jpg): Permission denied in /home/internet/public_html/chanta/galleries/admin/process.php on line 57
I've tried, through the script, to chmod the files so anyone can work with them, but I get the same Permission denied error.
I know that I had trouble through FTP deleting the files the script created, so I had to write another little script to delete those files (And dir) if needed.
Any idea what I can do here? There is always the fallback of having the user delete the uploaded dir via their FTP client, but I'd like to avoid it if at all possible, since htey might be doing a large batch of uploads at one time.
Source: http://www.livejournal.com/community/webdesign/1028698.html