note 26726 added to features.file-upload

From: Date: Mon, 11 Nov 2002 02:01:08 +0000
Subject: note 26726 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-39279@lists.php.net to get a copy of this message
I had trouble with my file uploader, the reason was that the file is deleted from the temporary directory at the end of the request if it has not been moved away or renamed. The way that I solved this problem was specifying the file like this: if(is_uploaded_file($_FILES['userfile']['tmp_name'])) { copy($_FILES['userfile']['tmp_name'], "../somefolder/" . $_FILES['userfile']['name']); } By specifying the file with $_FILES['userfile']['name']); and MAKING SURE THAT THE DESTINATION FOLDER HAS THE PRIVILEGES NEEDED (CHMOD 777), you wont have any problem. -- http://www.php.net/manual/en/features.file-upload.php http://master.php.net/manage/user-notes.php?action=edit+26726 http://master.php.net/manage/user-notes.php?action=delete+26726 http://master.php.net/manage/user-notes.php?action=reject+26726

« previous php.notes (#39279) next »