Details
-
Type:
Bug
-
Status:
Reopened
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.10.5
-
Fix Version/s: 1.10.7
-
Component/s: Zend_File_Transfer
-
Labels:None
Description
Please notice that there seems to be a heavy bug if you try to use the "rename" filter on each file before "receive" (to prevent problems with files being uploaded that have identical the same name (but don't have to be the same file)):
Register a filter object instead of the 3-parameter-style to make it work, as following:
<?php [...] //Dateien individuell umbenennen, sonst gibt es Probleme mit gleichnamigen Dateien. $files = $parFileTransfer->getFileInfo(); //Achtung, Dateien sind an dieser Stelle noch temporär! $i = 0; foreach($files as $key => $fileInfo){ if(!$fileInfo['name']==''){ //Jede Datei in ein eigenes, zufälliges Verzeichnis verschieben um Namenskonflikte zu verhindern. $parFileTransfer->addFilter( new Zend_Filter_File_Rename( array( 'source' => $fileInfo['tmp_name'], 'target' => $i.$key) ) ); $i++; } } [...] ?>
<-- Result absolutely OK!
—
The following did not identify the files correctly, even if it should! Result was, that all files were named the same (identity seems to be set wrong in rename). The rename filters were wrongly applied on all files though.
DO NOT USE (this part):
<?php
[...]
$parFileTransfer->addFilter('Rename', $i.$key, $fileInfo['tmp_name']);
[...]
?>
Changed code stlyle