<input type = "file" name = "mImage[]">
<input type = "file" name = "mImage[]">
<input type = "file" name = "mImage[]">
<input type = "file" name = "mImage[]">
if($_FILES['mImage']['size'] == 0){ echo "File not uploaded"}
if(file_exist($dir . $_FILES['mImage']['name'])){ echo "File already exist"}
I'm able to upload four images, but pretending to be the user to upload a file the second, but want to upload one, my code echos out "File already exist"
. I've used the file_exist
function. My assumption for my code assuming the file already exist with only uploading one file the second time (and the one file doesn't exist in the directory), is it thinks the $_FILES['mImage']['name'] = "."
or ".."
. If that is the case, then I can implement a code to ignore "."
or ".."
. I need assistance as why my code thinks the file already exist when I upload one file the second time.