I'm having trouble debugging why the processing of my file upload is not working. I've created a HTML5 file uploader on my page which calls my upload.php.
upload.php
// File should be saved in same folder as upload.php
$uploaddir = '/';
$uploadfile = $uploaddir . basename($_FILES['fileToUpload']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.
";
} else {
echo "Possible file upload attack!
";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
The result of my debug shows me the following:
move_uploaded_file appears to return false and thus not being able to move the uploaded file from temp location to my specified location.
I've made sure to set the permissions on the folder where my upload.php resides and where the file should be save to 777.
Question Is there any way to get more information about why the file was not saved to help me understand what i did wrong ?