note 73219 added to function.copy

From: Date: Tue, 13 Feb 2007 20:48:37 +0000
Subject: note 73219 added to function.copy
Groups: php.notes 
Request: Send a blank email to php-notes+get-123331@lists.php.net to get a copy of this message
It seems as though you can only use move_uploaded_file() once on a temporary file that has been uploaded through a form. Most likely the action this function takes destroys the temporary file after it has been moved, assuming permanent placement on a file system. Attempting to use the function again in the same PHP script will return false and not move the file. I ran into this when an image that was uploaded did not need resizing (smaller than a size threshold) and after moving the temporary upload to the "originals" directory, an attempt was made to again move the temporary file to another folder. This behavior is understandable, but be careful - in this instance, I simply used copy() on the file that was already uploaded. ---- Server IP: 64.71.164.2 Probable Submitter: 65.13.84.135 ---- Manual Page -- http://www.php.net/manual/en/function.copy.php Edit -- https://master.php.net/note/edit/73219 Del: integrated -- https://master.php.net/note/delete/73219/integrated Del: useless -- https://master.php.net/note/delete/73219/useless Del: bad code -- https://master.php.net/note/delete/73219/bad+code Del: spam -- https://master.php.net/note/delete/73219/spam Del: non-english -- https://master.php.net/note/delete/73219/non-english Del: in docs -- https://master.php.net/note/delete/73219/in+docs Del: other reasons-- https://master.php.net/note/delete/73219 Reject -- https://master.php.net/note/reject/73219 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123331) next »