只上传了20张图片

时间:2014-10-24 06:32:04

标签: php mysql

我试图上传100张图片,但我只上传了20张图片? 有人可以告诉我下面的代码有什么问题吗?

HTML code:

  <input type="file" name="filepic[]" multiple/>

PHP代码:

         foreach ($_FILES ['filepic']['tmp_name'] as $key => $tmp_name)
{
    echo $fileNamei  = $_FILES ['filepic']['name'][$key];
    $fileSize  = $_FILES ['filepic']['size'][$key];
    $fileTmp   = $_FILES ['filepic']['tmp_name'][$key];
    $fileType  = $_FILES ['filepic']['type'][$key];
    $partnerNum  = rtrim($fileNamei, ".jpg");

    $img = rtrim($fileNamei, ".jpg");
    $imgName = $img.'-'.$batchnumber.'.jpg'; 
    $dir = "../../Libraries/PenImage";
    move_uploaded_file ($fileTmp, "$dir/".$imgName);    

    $partner    = $partnerNum;
    $batchnum   = $batchnumber; 
    $uplDate    = $uplDatep;
    $timeUpl    = $timeup;
    $fileName   = $imgName;
    $fileSize   = $fileSize;
    $fileType   = $fileType;

    if ($partnerNum)
    { 
       $inserPic = $obj ->insertImage($partner, $batchnum, $uplDate, $timeUpl, $fileName, $fileSize, $fileType);
    }
     //error = validation
$picerr = array();
$errNotification = false;

  if (!$partnerNum)
{
    $picerr[] = 'NO Pensioner/s Image Uploaded';
    $errNotification = true;
}

if ($errNotification)
{
    $_SESSION['imgErr'] = $picerr;
    header('location:../../Pages/Uploading/uploadImageupdate.php');
}  

1 个答案:

答案 0 :(得分:0)

您的php.ini限制为最多20个POST元素。将max_file_uploads=20更改为更高的值。