0
我有上传用PHP Zend框架的多个文件的一个问题确定哪些文件接收(多个文件上传zendframwork)
我有其中包含许多输入[类型=“文件”]的标签的形式,每个标签具有其唯一的名称和ID属性。
当接收到这些数据时,所有文件都收集在一个数组文件中,我现在可以很容易地接收和存储它,但是这里的问题是如何识别哪个文件来自哪个输入元素?我知道这一点非常重要,因为每个特定文件都将存储在我的数据库的特定字段中。
这里的例子
<input type "file" name = "main_photo"/>
<input type "file" name = "horizontal_plan"/>
$upload = new Zend_File_Transfer_Adapter_Http();
$files = $upload->getFileInfo();
foreach ($files as $file => $info)
{
if($upload->isValid($file))
{
//here how can i point to the main_photo file or the horizontal_plan file?
}
}
请帮忙,谢谢提前。
谢谢Pushpesh,但我试过,但是当我打印文件[“文件名”]它没有打印任何东西。 – 2012-04-04 10:02:33
看看这是否可以帮助你 - http://ahsangill.wordpress.com/2009/02/17/zend-framework-file-upload-using-zend_form_element_file/ – 2012-04-04 10:05:39
不幸的是,我一直在使用类似的代码上传,但我仍然解决不了问题,谢谢你的帮助。 – 2012-04-05 09:43:28