note 51579 added to function.move-uploaded-file
| From: | andrew at euperia | Date: | Mon, 04 Apr 2005 21:29:51 +0000 |
| Subject: | note 51579 added to function.move-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87451@lists.php.net to get a copy of this message | ||
Instead of using chdir or chmod 0777 a safer alternative to move_uploaded_files is to use PHP's
ftp functions to move the file into a web dir.
1. Make ftp connection to 127.0.0.1 with the correct username and password.
2. ftp_chdir to the required directory.
3. ftp_put ($_FILES['myfile']['tmp_name'], $finalfilename);
4. ftp quit.
----
Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51579
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51579&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51579&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51579&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51579&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51579&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51579&report=yes
Search -- http://master.php.net/manage/user-notes.php