for some reason i cannot get my file uploader to work
html:
<form enctype="multipart/form-data" action="uploader.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:
<?php
// Where the file is going to be placed
$target_path = "uploads/";
/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$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!";
}
?>
Errors that i'm getting:
Warning: move_uploaded_file(uploads/admin.png) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\wamp\www\uploader.php on line 10
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\php74E0.tmp' to 'uploads/admin.png' in C:\wamp\www\uploader.php on line 10
There was an error uploading the file, please try again!