RE: [PHP] Moving Files/ Temporary Names
| From: | Ford, Mike [LSS] | Date: | Tue, 15 Jul 2003 09:19:04 +0000 |
| Subject: | RE: [PHP] Moving Files/ Temporary Names | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-155250@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: caspar kennerdale [mailto:caspar@pushingtheboundary.com]
> Sent: 14 July 2003 21:05
>
>
> If you want the file to go into a holding location until your
> administrator
> can approve it and move it to its real final location, then
> the holding
> location should be the target of the move_uploaded_file().
> This makes it up
> to you to decide what you want the structure of your holding
> location to be,
> and how you want to keep track of any files currently populating it.
>
> - I'm a little confused. The files are already in there real
> location.
Ah -- this wasn't clear before. Then these are no longer uploaded files --
only the temp file created by the original form submission is truly an
uploaded file in the sense that is_uploaded_file() will be true and you can
move_uploaded_file() it. Once you have used move_uploaded_file() on it, the
new file is just a regular file, not an uploaded one.
> It is
> just that someone may want to change that location at a later date.
> e.g. they upload an image to a folder and two months later
> decide it is
> better placed in a different folder.
Then you just want rename() -- http://www.php.net/rename
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211