note 21985 added to function.move-uploaded-file

From: Date: Sun, 02 Jun 2002 22:48:26 +0000
Subject: note 21985 added to function.move-uploaded-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-31361@lists.php.net to get a copy of this message
I am running Omnihttpd on Windows XP and had a few problems with access rights when moving uploaded files. However, if I specify the temp file property as the source file, then write the complete path including the filename as the destination, it works: if (is_uploaded_file($userfile)) { $savepath = $DOCUMENT_ROOT . "\\\\uploads\\\\" . $userfile_name; move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], $savepath); } Note the multiple \ characters - you must use double \ otherwise PHP will escape with the next character (and create some mad paths!) -- http://www.php.net/manual/en/function.move-uploaded-file.php http://master.php.net/manage/user-notes.php?action=edit+21985 http://master.php.net/manage/user-notes.php?action=delete+21985 http://master.php.net/manage/user-notes.php?action=reject+21985

« previous php.notes (#31361) next »