This is a strange one. I have an upload function that uploads all selected images from the client's computer to the server. This is working, however, when selecting a large number of images it cuts off after 19 images. I tried uploading 71 images and every time I check the number of images in $_FILES it only contains 19. Has anyone had this issue before? See my code below:
HTML
<input type="file" webkitdirectory mozdirectory msdirectory odirectory directory multiple class="" id="image_folder" name="image_folder[]" value="" style="display: none;"/>
PHP
//Upload book images
if (count($_FILES['image_folder']['name']) > 0) {
for($file = 0; $file < count($_FILES['image_folder']['name']); $file++) {
//Get the temp file path
$tmpFilePath = $_FILES['image_folder']['tmp_name'][$file];
//Make sure we have a filepath
if ($tmpFilePath != "") {
//save the filename
$shortname = $_FILES['image_folder']['name'][$file];
$directoryName = "../Authors/AUT".sprintf("%09d", $AUT_ID)."/Content/";
//Check if the directory already exists.
if (!is_dir($directoryName)) {
mkdir($directoryName, 0755, true);
}
//save the url and the file
$filePath = "../Authors/AUTH".sprintf("%09d", $AUTH_ID)."/Content/".$shortname;
//Upload the file into the dir
if (move_uploaded_file($tmpFilePath, $filePath)) {
//TODO:: Save path to database.
}
}
}
}
So like I said, my code works and 19 images are uploaded out of the total 71. I have checked my Server's max execution time as well and amended it. However, it still makes no difference. Besides, I don't think it has something to do with that as the total count of Images in $_FILES are is only 19 instead of 71.