ZF-5990: getFileName returns wrong file name (for form with 2 elements: file and file_two)
I added two times a Zend_Form_Element_File, one with the name 'file', the other with the name 'file_two'. When asking the Zend_Transfer_Adapter for getFileName('file'), I get an array with both elements (fair enough; though I still find this weird). However, when asking for getFileName(), it returns the following:
var_export($adapter->getFileName()); array ( 'file_two' => 'D:\\tmp\\php\\uploads\\size-256.txt', 'file' => 'Array\\size-1024.txt', )
("D:\tmp\php\uploads\" being my upload_tmp_dir).
Problem is, of course, the second element, which has 'Array' instead of the directory. This is because when asking for getDestination($file) (which getFileName does), it returns an array with both elements:
var_export($adapter->getDestination['file']); array ( 'file_two' => 'D:\\tmp\\php\\uploads', 'file' => 'D:\\tmp\\php\\uploads', )
I've tested with 1.7.6 as well as the SVN version from http://framework.zend.com/svn/framework/… (revision 142740).
You can, of course, make the name yourself with getFileInfo(), concatenating the destination, a DIRECTORY_SEPARATOR and the name. However, from what I see, that file doesn't exist either.