doupi1532 2011-06-07 16:05
浏览 14

Zend文件传输:上传单个图像时出现问题

I cannot understand how ->isuploaded() works. I am suppose to upload six images to display on my index page. Now the problem is, in my update function, if I upload only one or two image $upload->isUploaded() returns a false value, but if I decide to update all six of them it returns a true value. How do I deal with this problem? Am i missing out something here?

Here is my zend file transfer upload

$upload = new Zend_File_Transfer();
$upload->addValidator('Count', false, array('min' =>1, 'max' => 6)) 
               ->addValidator('Size', false, array('max' => '1Mb'))
               ->addValidator('ImageSize', false, array('minwidth' => 50,
                                                        'maxwidth' => 1000,
                                                        'minheight' => 50,
                                                        'maxheight' => 1000));

if ($upload->isUploaded()) $hasImage = true;
  • 写回答

2条回答 默认 最新

  • dongshan3759 2011-06-07 16:09
    关注

    Use isValid() instead.

    if ($upload->isValid()) {
        // success!
    } else {
        // failure!
    }
    

    Once you know your upload passed the validators, then start processing the images.

    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制