Thanks for the info.
I tried it in a test file and it seems to work except that after uploading is done, I don't see the file in the firectory I have specified. It is stored in the temp directory.
Since this is a site hosted by an outside hosting company, I cannot modify the php.ini file, as directed in the php manual. This is what I have and the output:
<form action="test_upload.php" method="post" enctype="multipart/form-data">
<p>Pictures:
<input type="file" name="pictures" />
<input type="submit" value="Send" />
</p>
</form>
test_upload.php:
$uploaddir = '/home/mydomain/www/demo/images/uploads';
$uploadfile = $uploaddir . basename($_FILES['pictures']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['pictures']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>
Output:
File is valid, and was successfully uploaded.
Here is some more debugging info:Array
(
[pictures] => Array
(
[name] => bg_blue.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpc7nOLo
[error] => 0
[size] => 14772
)
)