Help on uploading files and permission issues
| From: | Vam | Date: | Tue, 29 Apr 2003 18:46:45 +0000 |
| Subject: | Help on uploading files and permission issues | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145684@lists.php.net to get a copy of this message | ||
Hi,
I am stuck on how to upload a file and use the
move_uploaded_file function. I am running PHP 4.3 on
linux/apache and have set my upload_tmp_dir to '/tmp'.
It is some permissions issue but I tried doing 'chmod
o+rwx' as well as making sure the script uid matches
the directory.
When I run my script it says:
Warning:
move_uploaded_file(/usr/local/apache/htdocs/UPLOADS/TEMP-ing.txt)
[function.move-uploaded-file]: failed to create
stream: No such file or directory in
/usr/local/apache/htdocs/upload.php on line 28
Warning: move_uploaded_file()
[function.move-uploaded-file]: Unable to move
'/tmp/php6RVSBc' to
'/usr/local/apache/htdocs/UPLOADS/TEMP-ing.txt' in
/usr/local/apache/htdocs/upload.php on line 28
My code is as follows:
$source = $file['tmp_name'];
$dest = "/usr/local/apache/htdocs/UPLOADS/TEMP-" .
$file['name'];
if ( move_uploaded_file( $source, $dest )) {
$valid = 1;
} else {
$result .= "Error: failed to upload file. Please
try again later <br/>";
}
Any help would be appreciated -
-V
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com