Re: Copying an uploaded file...
| From: | John Nichel | Date: | Wed, 29 Oct 2003 23:11:51 +0000 |
| Subject: | Re: Copying an uploaded file... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168090@lists.php.net to get a copy of this message | ||
René Fournier wrote:
Thanks John. I've simplified and improved the quote per your suggestions, but still no dice. (I'[m running OS X 10.2.8.) Here is the code:
// MOVE FILE
if (move_uploaded_file($_FILES['userfile']['tmp_name'],$_FILES['userfile'][ 'name'])) {
echo "Success!";
} else {
echo "NO!!!";
}
Here are the results:
Give it a path for the file to be moved too...
if(move_uploaded_file($_FILES['userfile']['tmp_name'], "/path/to/save/" . $_FILES['userfile']['name'])) {
NO!!!Array ( [img_photo] => Array ( [name] => apache_pb.gif [type] => image/gif [tmp_name] => /var/tmp/phpvnTFqr [error] => 0 [size] => 2326 ) )Should the tmp directory maybe be set elsewhere? (If so, how can that be done? I've looked at the httpd.conf file, but there is no entry for upload tmp directory.) Many thanks in advance. ...Rene -- By-Tor.com It's all about the Rush http://www.by-tor.com