note 23868 added to function.move-uploaded-file
| From: | kdechant at midwestarts dot com | Date: | Tue, 30 Jul 2002 16:10:14 +0000 |
| Subject: | note 23868 added to function.move-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33997@lists.php.net to get a copy of this message | ||
A followup to my note above about the files having a mode 600 and owner nobody:
I handle this by calling the PHP chmod function immediately after saving the file. Here is an
example:
move_uploaded_file($temp_filename, $destination_filename);
chmod($destination_filename, 0644);
Mode 0644 (the zero is required) will allow everyone to read but not modify the file. That allows
you to download it with FTP. You can use 0666 if you need to overwrite the file with FTP, but that
is probably less secure.
--
http://www.php.net/manual/en/function.move-uploaded-file.php
http://master.php.net/manage/user-notes.php?action=edit+23868
http://master.php.net/manage/user-notes.php?action=delete+23868
http://master.php.net/manage/user-notes.php?action=reject+23868