Re: Moving Files - Stupid Error
| From: | Justin French | Date: | Sat, 17 Aug 2002 01:24:09 +0000 |
| Subject: | Re: Moving Files - Stupid Error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113038@lists.php.net to get a copy of this message | ||
The function move_uploaded_file() is what you want, not copy().
http://php.net/move_uploaded_file
Of course, there are full working examples in the manual, found doing a
simple whole-site search on "file upload".
http://www.php.net/manual/en/features.file-upload.php
Justin French
on 17/08/02 2:53 AM, Steve Keller (skeller@healthtvchannel.org) wrote:
> ack to the tmp directory to look for the file. Here's a
> sample error:
>
> Warning: Unable to create '/test/data/test.txt': No such file or directory
> in /usr/local/www/vhosts/healthtvchannel.org/htdocs/test/upload.php on line 17
>
> That's with using:
>
> copy("{$UploadedFile}","/test/data/".$UploadedFile_name);
>
> $UploadedFile being the name I'm using. Both variables seem to be returning
> correctly. $UploadedFile returns the temp name, and $UploadedFile_name
> returns the actual name. The file is also far under the maximum file size.
> The /test/data has Nobody write permissions, I know because I'm writing to
> a file in it with another script, and there's no file in there with the
> same file name to cause overwriting ownership conflicts.