PHP: No input file specified
Using an example from http://www.tizag.com/phpT/fileupload.php. I am using PHP 5.3 at godaddy
I get this error using the above example "No input file specified."
I get the error in the sequence when I hit the "upload File" button.
<form enctype="multipart/form-data" action="uploade开发者_运维知识库r.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
<?php
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
Both upload.php and upload-file.html are in the same directory.
and i have the "uploads" directory in there
Just quickly Google the message and it looks like you might be getting the message from PHP as an Apache CGI because 'uploader.php' doesn't exist or is not in the same directory as the one with the HTML form - what are your files called and what are their paths on the server?
See the 'action' attribute of the <form> element of your HTML file.
精彩评论