Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

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

Merged
weierophinney merged 1 commit intozendframework:masterfromcodisart:bugfix-allow-same-filename-upload
Feb 16, 2016
Merged

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

weierophinney merged 1 commit intozendframework:masterfromcodisart:bugfix-allow-same-filename-upload
Feb 16, 2016

Conversation

@codisart
Copy link
Contributor

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.

I have adjusted the unit test for the File/Transfer/Adapter/HttpTest::testMultiFiles() method and added one for a same name case.

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 galleryIn 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.- Fix the unit tests and add a new one for the same filename case.
@codisartcodisart 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 fileJan 25, 2016
@weierophinneyweierophinney added this to the2.5.2 milestoneFeb 16, 2016
@weierophinneyweierophinney self-assigned thisFeb 16, 2016
@weierophinneyweierophinney merged commit47e9599 intozendframework:masterFeb 16, 2016
weierophinney added a commit that referenced this pull requestFeb 16, 2016
[BUG] This fix allows the upload of same filenames in input type file
weierophinney added a commit that referenced this pull requestFeb 16, 2016
weierophinney added a commit that referenced this pull requestFeb 16, 2016
weierophinney added a commit that referenced this pull requestFeb 16, 2016
@wolxXx
Copy link

sadly, this breakes the possibility to save the original file name.
in my case, a single file is uploaded with the example name "foobar.jpg" and will be renamed to "[php_3532 as php tmp file name]_foobar.jpg"... so now i must parse the tmp file out of the new file name..
that's weird..
it would be nice if the rename inhttps://github.com/zendframework/zend-file/blob/master/src/Transfer/Adapter/Http.php#L454 would be optionally.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

@weierophinneyweierophinney

Projects

None yet

Milestone

2.5.2

Development

Successfully merging this pull request may close these issues.

3 participants

@codisart@wolxXx@weierophinney

[8]ページ先頭

©2009-2025 Movatter.jp