contao / core

Contao 3 → see contao/contao for Contao 4
GNU Lesser General Public License v3.0
490 stars 214 forks source link

File upload on iOS devices flawed #8143

Open Teetrinker opened 8 years ago

Teetrinker commented 8 years ago

Contao 3.4.4 iOS9.1 uf iPhone und iPad mini PHP 5.4.32 When a file is selected for upload, the upload happens, the green tick is shown, but the file is named "image.jpg" and replaces the pre-existing "image.jpg". Also, if multiple images are uploaded, only the last one persists.

(It was not possible to test this case in the demo.contao.org because of the upload restrictions.)

leofeyer commented 8 years ago

Can anyone reproduce this?

fenepedia commented 8 years ago

Yes, I can confirm this. Every uploaded file ist renamed to "image.jpg" and overwrites each other.

kikmedia commented 8 years ago

This is the default behaviour if you are on iOS due to security reasons. The image name is 'image.jpg' for every image since it is only a database object on an iOS device. As far as I know one should create an individual file name by yourself (e.g. the upload function), especially on chunked uploads.

I personally think that this issue could either be handled via an external library (like https://github.com/blueimp/jQuery-File-Upload, for example) or by Contao itself.

leofeyer commented 8 years ago

@contao/developers /cc

ausi commented 8 years ago

How about never overwriting files via the upload and instead append a number until the file name is available? This would create image.jpg, image-2.jpg, image-3.jpg.

In order to still be able to replace a file we could add a “replace file” button for files.

fritzmg commented 8 years ago

How about never overwriting files via the upload and instead append a number until the file name is available? This would create image.jpg, image-2.jpg, image-3.jpg.

In order to still be able to replace a file we could add a “replace file” button for files.

Related: contao/contao#5388

leofeyer commented 8 years ago

As discussed in Mumble on April 21st, we should add numeric suffixes if there are multiple files with the same name in a request.

fritzmg commented 8 years ago

As discussed in Mumble on April 21st, we should add numeric suffixes if there are multiple files with the same name in a request.

But this won't fix this part of the issue:

When a file is selected for upload, the upload happens, the green tick is shown, but the file is named "image.jpg" and replaces the pre-existing "image.jpg"

If you upload images one by one into a folder with the Contao uploader with an iOS device, only one image will remain.

leofeyer commented 8 years ago

We cannot fix this. You will have to upload an image, rename it, then upload the next one, rename it, and so on.