ZF-11635: Zend_Filter_File_Rename does not keep the original filename if a target directory was provided
Description
According to http://framework.zend.com/manual/en/…, when supplying a directory in the "source" argument (whether as an argument or inside an array), the original filename should be kept. However, it is not kept, and is saved with the following example's pattern: "phpX34d".
Calling $adapter->getFileName() inside the addition of the rename filter (in order to append the original file name to the directory) retrieves the entire path of where the file will be saved prior to the filtering (as the filter is not yet applied) which is something like "/tmp/originalFileName.jpg".
The above refers to a linux file system. Haven't checked this behavior under a Windows file system.
Comments
Posted by Thomas Weidner (thomas) on 2011-08-02T16:17:30.000+0000
Please provide an reproduceable example of your problem.
Note: It is a difference if you call methods prior receiving/validation/filtering or afterwards. The values you get can differ in such a case.
Posted by Thomas Weidner (thomas) on 2011-08-15T17:45:34.000+0000
Closing as incomplete since there is no response since several days
Feel free to reopen as soon as you give an example of your problem by code
Posted by Brian Morton (rokclimb15@gmail.com) on 2012-09-18T17:56:20.000+0000
I think I can shed some light on this. The reporter was probably led to believe this was occurring by a poorly formed exception message:
This should probably sprintf the $file['target'] or at least include it additionally to make clear that /tmp/phpXXXX could not be renamed to $file['target']