开发者

How to get second file during upload with Zend Framework

I have 2 file controls on the form - one for logo and one for big ima开发者_如何学JAVAge and

this code didn't work

$upload = new Zend_File_Transfer_Adapter_Http();
$upload->addValidator('Count', false, array('min' =>0, 'max' => 2));

$files = $upload->getFileInfo();            

foreach ($files as $file => $info) 
{
    if($upload->isValid($file)){ .. do receive ..}
}

and this code works well

$upload = new Zend_File_Transfer_Adapter_Http();
$upload->addValidator('Count', false, array('min' =>0, 'max' => 2));

$files = $upload->getFileInfo();            

foreach ($files as $file => $info) 
{
    if(!empty($info['name'])){ .. do receive ..}
}

when I upload file only for the second file

why is it so?


foreach ( $upload->getFileInfo() as $file )
{
   ... play with validation and receive here ...
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜