IOS file upload - original file name

I have a simple HTML file loading snippet that works under iOS. However, my problem is that the file name of the downloaded file will always be "image.jpeg". Is there a way to get the original file name - that is, "IMG_0001.jpg" instead? The main problem is that if I have 2 files, they have the name "image.jpeg" as opposed to their unique names.

+4
source share
1 answer

Safari on iOS will always indicate the name of the downloaded file image.jpeg, presumably for security / privacy purposes. You need to create your own name for the files, which is a good idea in general for downloaded files: you never want to trust the client too much.

If you configure more than just Safari on iOS, you still have to handle this case, because it’s reasonable for people to be able to upload multiple files with the same name but originally located in different directories.

+2
source

Source: https://habr.com/ru/post/1625292/


All Articles