이전 스크립트 (오래된 방법)입니다. 스크립트가 작동하지만 이미지가 올바른 순서로 업로드되지 않습니다. 나는 정확하게 확신하지는 않지만 그들이 처음부터 끝까지 업로드하는 대신 마지막에서 업로드하는 것으로 보입니다. 그게 뭐예요?이미지가 잘못된 순서로 업로드됩니다.
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]);
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,
picfile = '$newfile'";
mysql_query($sql);
if (mysql_error())
{
...
http://stackoverflow.com/questions/12108468/does-multiple-upload-follow-the-same-order-of-uploading-in-which-we-select-the-i –
아닙니다. 나는 그것을 시도했다. 업로드 한 후에도 여전히 되돌려 진 것처럼 보입니다. 마지막으로 업로드하는 것처럼 보입니다. $ _FILES [ 'pic'] [ '1'] || $ _FILES [ 'pic'] [ '2'] 등 – Alex333