hi...i try to upload file...but got error...here i submit my coding..
#uploadForm1
<html>
<head>
<title># of Files to Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <br>
<br>
<input name="uploadedfile" type="file" />
<br>
<input name="submit" type="submit" value="Upload File" />
</form>
</body>
</html>
#uploader
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?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;
/* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$_FILES['uploadedfile']['tmp_name'];
$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!";
}
?>
</body>
</html>
the error i got is
Warning: move_uploaded_file(uploads/printer.txt): failed to open stream: No such file or directory in c:\program files\easyphp1-7\www\smtt\uploader.php on line 16
Warning: move_uploaded_file(): Unable to move 'C:\Program Files\EasyPHP1-7\tmp\php7B.tmp' to 'uploads/printer.txt' in c:\program files\easyphp1-7\www\smtt\uploader.php on line 16
There was an error uploading the file, please try again!