Re: File Upload Security and chmod

From: Date: Mon, 25 Sep 2006 20:26:30 +0000
Subject: Re: File Upload Security and chmod
References: 1 2 3 4 5 6 7 8 9  Groups: php.general 
Request: Send a blank email to php-general+get-242203@lists.php.net to get a copy of this message
On 9/25/06, Andy Hultgren <wearhdphp@gmail.com> wrote:
Tedd, Thanks so much your thorough response - it's good to know that I'm not the only one trying to figure this out! I'm curious, in your code you use the PHP ftp functions, but I have used the PHP functions chmod() and mkdir() without establishing an ftp connection. Is it faster to establish an ftp connection within PHP and then use the ftp series of functions to accomplish all of the directory creation and permissions changes? If so, then I will probably change my code to follow yours. Andy
By using FTP you can specify which user account you want the connection to be established at. When running a PHP script the script will be running by the Apache server, which means it will have specific permission levels which cannot create directories or chmod unless Apache owns the parent directory. That is why Tedd went through all that trouble.

« previous php.general (#242203) next »