I took this basic upload file script from php.net and it is giving two warning before it move the image to the directory.
Warning:
move_uploaded_file(public_html/your/inventory_images/penguin.jpg)
[function.move-uploaded-file]: failed to open stream: No such file or
directory in /home3/ny/public_html/your/anotherformsale.php on line 73Warning: move_uploaded_file() [function.move-uploaded-file]: Unable
to move ‘/var/tmp/phpnIxYMK’ to
‘public_html/your/inventory_images/penguin.jpg’ in
/home3/ny/public_html/your/anotherformsale.php on line 73
I am getting this warning after I have tried to upload a image with a basic move_upload script below.
<?php
$uploaddir ='public_html/your/inventory_images/';//<----This is all I
changed $uploadfile = $uploaddir . basename($_FILES['file']['name']);
echo '<pre>'; if (move_uploaded_file($_FILES['file']['tmp_name'],
$uploadfile)) {
echo "File is valid, and was successfully uploaded.\n"; } else {
echo "Possible file upload attack!\n"; }
echo 'Here is some more debugging info:'; print_r($_FILES);
print "</pre>";
?>
According to warning message(
No such file or directory in /home3/ny/public_html/your/anotherformsale.php on line 73) the path you are using is wrong.it should be set to
After confirmation of path you should also make sure the destination directory is writable.