I had to do it.
My point of view is :
PHP creates the temporary uploaded file with the minimum permission 600.
Then move_uploaded_file move the file in the destination directory.
If the temporary file and the destination file are in the same file
system, the permissions are not changed (same i-bode, as mv works)
If the temporary file and the destination file are in differents fille
systems, the UMASK is applied because PHP has to create a new i-node.
That's all I can imagine.
Seb
CountScubula wrote:
without getting into umask, why not chmod it after the move?
--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Seb" <sc************@cegetel.net> wrote in message
news:c1**********@reader1.imaginet.fr...
Hi,
I've got something strange when uploading files on a UNIX machine with
PHP 4.3.4 + Apache 1.3.29 :
The uploaded file is uploaded in /va/tmp with permissions 600 (that's
normal)
move_uploaded_file move it into the destination directory and
permissions stay to 600 also it should be 640 because the UMASK is 027.
If destination directory is /tmp the uploaded file gets the right
permissions : 640 (according to the UMASK at 027).
Strange isn't it, do you have a clue ?
Thx,
Seb