note 21985 deleted from function.move-uploaded-file by sniper

From: Date: Tue, 28 Jan 2003 05:16:16 +0000
Subject: note 21985 deleted from function.move-uploaded-file by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-42904@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!)

« previous php.notes (#42904) next »