Hello I am trying to upload a file a user selects on their local computer to my server through a form but I get the following php error:
Warning: move_uploaded_file(bqformtest/uploaded_files/test.doc)
[function.move-uploaded-file]: failed to open stream: No such file or
directory in /home/drawapl1/public_html/bqformtest/index.php on line
40Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move ‘/tmp/phphhS4QD’ to ‘bqformtest/uploaded_files/test.doc’ in
/home/drawapl1/public_html/bqformtest/index.php on line 40
This is my php code:
$target = "bqformtest/uploaded_files/";
$target = $target . basename( $_FILES['upload']['name']) ;
if(move_uploaded_file($_FILES['upload']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
This is my form code:
<form method='post' action='' accept-charset='UTF-8' enctype='multipart/form-data'>
<input type="file" name="upload" size="50" />
<input id="submitButton" type='submit' name='Submit' value='' />
</form>
The uploaded_files folders permissions is set to 755. Thanks in advance.
Provide full path to file, or right relative path
the path to file is wrong