Hi.
I can’t seem to upload images, the filename is entered into the database but the actual image does not upload…
This is the upload code:
$target_path = "../galleryimages/";
$target_path = $target_path . basename( $_FILES['file']['name']);
if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['file']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
My file upload box is like so:
<input type="hidden" name="MAX_FILE_SIZE" value="100000" /><input type="file" name="file" id="file" value=""/>
But i keep getting “There was an error uploading the file, please try again!”…
I tried doing a var_dump of the files, and this is what i got:
array(1) { ["file"]=> array(5) { ["name"]=> string(17) "Winter Leaves.jpg" ["type"]=> string(0) "" ["tmp_name"]=> string(0) "" ["error"]=> int(2) ["size"]=> int(0) } }
Any ideas what the problem might be?
Can someone please help as i can’t figure it out…
Thanks again