core icon indicating copy to clipboard operation
core copied to clipboard

File upload on iOS devices flawed

Open Teetrinker opened this issue 10 years ago • 9 comments

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.)

Teetrinker avatar Dec 02 '15 10:12 Teetrinker

Can anyone reproduce this?

leofeyer avatar Dec 15 '15 20:12 leofeyer

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

fenepedia avatar Mar 04 '16 06:03 fenepedia

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.

kikmedia avatar Mar 04 '16 07:03 kikmedia

@contao/developers /cc

leofeyer avatar Mar 08 '16 19:03 leofeyer

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.

ausi avatar Mar 09 '16 08:03 ausi

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

fritzmg avatar Mar 11 '16 09:03 fritzmg

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

leofeyer avatar Apr 21 '16 15:04 leofeyer

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.

fritzmg avatar Apr 21 '16 15:04 fritzmg

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

leofeyer avatar Apr 21 '16 19:04 leofeyer