NYCPHP Meetup

[nycphp-talk] Setting directory permissions

Chris Snyder chris at psydeshow.org
Sat Apr 19 11:00:17 EDT 2003


jsiegel1 at optonline.net wrote:

>The problem is...this only works if I chmod the subdirectory "pic_test" to 777 using my FTP application. However, I want to quickly change the permissions via PHP code, upload some pictures with my form, then change the permissions back to 755.
>
>Thoughts/comments greatly appreciated.
>
>Jeff
>
>  
>
Jeff-- a couple people have suggested solutions to this that involve 
giving the Apache user write-permission on the directory, which is 
traditionally the way to handle uploaded files.

I'd like to point out that there is another, and I believe better way, 
but it requires you to recompile PHP with the FTP functions enabled. 
After uploading the file, you FTP it to the directory where you want it 
to go. This has the added benefit of making the files owned by you 
instead of by nobody, meaning you can edit or delete them later.

If this is something you want to try, check out Fiatlux: 
http://fiatlux.chxo.com
It uses this method to enable web users to create directories and upload 
files that can also be admin'd via FTP.

    chris.




More information about the talk mailing list