I am trying to create a upload form through which the user can enter certain details(including a file upload) and then it will be inserted into a database, the row is entered successfully but I get this error. i.e Warning: move_uploaded_file(upload/computer/SIGN 001.jpg): failed to open stream: No such file or directory in C:\wamp\www\stockm.php on line 28 & Warning: move_uploaded_file(): Unable to move 'C:\wamp\tmp\php2CEE.tmp' to 'upload/computer/SIGN 001.jpg' in C:\wamp\www\stockm.php on line 28
this is the code which has the entire scripting for the upload file portion.
$name= $_FILES['file']['name'];
$tmp_name = $_FILES['file']['tmp_name'];
$type = $_FILES['file']['type'];
$size = $_FILES['file']['size'];
$pathAndName = "upload/computer/".$name;
$moveResult = move_uploaded_file($tmp_name, $pathAndName);
I have created a folder in C:/wamp/upload named computer where I want the image to be sent, in the database I get this location but in upload/computer there is no file, the folder is empty.
wwwand are trying to upload to/wamp/www/uploadwhich probably does not exist. Use an absolute path for the target path as well