0

Warning: move_uploaded_file(../uploads/IMG_23052014_111633.png): failed to open stream: No such file or directory in C:\wamp\www\test.co\getfile.php on line 8
Warning: move_uploaded_file(): Unable to move 'C:\wamp\tmp\php9EF8.tmp' to '../uploads/IMG_23052014_111633.png' in C:\wamp\www\test.co\getfile.php on line 8

how to get rid of it?
HTML code:

<form action="getfile.php" method="post" enctype="multipart/form-data" ><br>
Type (or select) Filename: <input type="file" name="uploadFile">
<input type="submit" value="Upload File">
</form>


PHP code:

<html>
<head>
<title>Process Uploaded File</title>
</head>
<body>
<?php
move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], 
"../uploads/{$_FILES['uploadFile'] ['name']}")
?>
</body>
</html>
Tryhard
  • 5
  • 5
  • 1
    enctype attribute is missing in your form – Amit Verma Apr 11 '15 at 13:46
  • @AmitThakur what do you mean so what should i do? – Tryhard Apr 11 '15 at 13:48
  • Check this question for more info on - [What does enctype='multipart/form-data' mean?](http://stackoverflow.com/questions/4526273/what-does-enctype-multipart-form-data-mean) – Amit Verma Apr 11 '15 at 13:54
  • @AmitThakur i did add it it does not change the error – Tryhard Apr 11 '15 at 13:55
  • Did the question marked by Rizier help you? – Amit Verma Apr 11 '15 at 13:59
  • @AmitThakur honstly it might help but iam new to php so even if the answer is there icant implement it iwant some one to answer this question by using exactly the same code iam using and changing it to the right way – Tryhard Apr 11 '15 at 14:01
  • This post might help you- http://www.tizag.com/phpT/fileupload.php **Thank you Tizag!** – Amit Verma Apr 11 '15 at 14:09
  • @AmitThakur nope i did every thing and i get this >There was an error uploading the file, please try again! – Tryhard Apr 11 '15 at 14:20
  • Then there is something wrong with your filesystem, check the folder permission.. A few days ago I pasted a multiple file upload script => https://eval.in/298954 hope this helps! – Amit Verma Apr 11 '15 at 14:26
  • There you need to change just 1 single line => **$path="path/";** to **$path="your_directory_and_then_a_slash/"** – Amit Verma Apr 11 '15 at 14:36

0 Answers0