Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

[BUG] This fix allows the upload of same filenames in input type file #652

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

[BUG] This fix allows the upload of same filenames in input type file #652

wants to merge 3 commits into from

Conversation

codisart
Copy link

@codisart codisart commented Dec 4, 2015

For example, Safari on IOS gives the name image.jpg for pictures from the gallery
In the present situation, the first files would be overriden by the last file with the same name.
And the getValue of these inputs will return the same fileName with no really mean to identify it.
With the use of the unique name from PHP $_FILES in the name column of the $_files array of the Http adapter, the files will be unique and easily identifiable.

@froschdesign
Copy link
Member

@codisart
Sorry, but I can not found a signed CLA.

And the unit tests fails.

@codisart
Copy link
Author

codisart commented Dec 7, 2015

@froschdesign
The CLA has been accepted.

For the unit tests, I was having some trouble setting them up but it is ok now.

I have some questions about the failing unit test Zend_File_Transfer_Adapter_HttpTest::testMultiFiles.

First, the $_FILES is mocked with the implication that the "name" value can be a path with more than one directory. Shouldn't it be only a filename like picture.jpg, document.docx or script.php ?

Secondly, the "tmp_name" value doesn't seem to be mocked properly, or the format %TMP_DIRECTORY%/php123456 can be overriden ?

codisart.

For example, Ios Safari gives the name image.jpg for pcitures from the gallery
In the present situation, the first files would be overriden by the last file with the same name.
And the getValue of these inputs will return the same fileName with no really mean to identify it.
With the use of the unique name from PHP $_FILES in the name column of the $_files array of the Http adapter, the files will be unique and easily identifiable.
@codisart codisart changed the title [BUG] This commit allows the upload of same filenames in input type file [BUG] This fix allows the upload of same filenames in input type file Jan 25, 2016
@vonglasow
Copy link

Hello @froschdesign, any news about this pull request ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants