Right now when you upload images the smaller size images get uploaded first. The whole upload process is overall random.
How can I tell this image uploader to upload images in the right order from the first to the last? In other words, the second image shouldn't start uploading until the first one has uploaded. The third image shouldn't start uploading until the second one has uploaded... etc., etc.
Code:<?php } // Upload pictures if (count($_FILES['pic']['tmp_name'])) { $ipval = ipval(); $uploaderror = 0; $uploadcount = 0; $errorMessages = array(); foreach ($_FILES['pic']['tmp_name'] as $k=>$tmpfile) { if ($tmpfile) { $thisfile = array("name"=>$_FILES['pic']['name'][$k], "tmp_name"=>$_FILES['pic']['tmp_name'][$k], "size"=>$_FILES['pic']['size'][$k], "type"=>$_FILES['pic']['type'][$k], "error"=>$_FILES['pic']['error'][$k]); // Check size if ($_FILES['pic']['size'][$k] > $pic_maxsize*1000) { $errorMessages[] = $thisfile['name'] . " - " . $lang['ERROR_UPLOAD_PIC_TOO_BIG']; $uploaderror++; } elseif (!isValidImage($thisfile)) { $errorMessages[] = $thisfile['name'] . " - " . $lang['ERROR_UPLOAD_PIC_BAD_FILETYPE']; $uploaderror++; } else { $newfile = SaveUploadFile($thisfile, "{$path_escape}{$datadir['adpics']}", TRUE, $images_max_width, $images_max_height); if($newfile) { $sql = "INSERT INTO $t_adpics SET adid = $adid, isevent = '$data[isevent]', picfile = '$newfile'"; mysql_query($sql); if (mysql_error()) { $errorMessages[] = $thisfile['name'] . " - " . $lang['ERROR_UPLOAD_PIC_INTERNAL']; $uploaderror++; } else { $uploadcount++; } } else { echo "<!-- {$k} - Permission error; can not copy -->"; $errorMessages[] = $thisfile['name'] . " - " . $lang['ERROR_UPLOAD_PIC_INTERNAL']; $uploaderror++; } } } elseif ($_FILES['pic']['name'][$k]) { echo "<!-- {$k} - Temp file not present -->"; $uploaderror++; } }
Code:<?php for ($i=1; $i<=$pic_count; $i++) { ?> <input type="file" name="pic[]" size="69"> <?php } ?>
Any help is appreciated.



Reply With Quote


Bookmarks