Home > Mobile >  When a user on an iPhone downloads a JPG file from my site, is it possible to direct that file to en
When a user on an iPhone downloads a JPG file from my site, is it possible to direct that file to en

Time:03-11

I don't have an iPhone so it's hard for me to test this, but I believe at the moment if someone downloads a JPG file from my site they then have to locate their Files app, and find the Downloads folder within it. Does that sound right?

I'd like for it to end up in their Camera Roll instead - is that possible? I couldn't find any resources on the subject.

Thank you

CodePudding user response:

It depends on the browser app, but mostly user have 2 options:

  • 'Save' image -> it's going to Camera Roll
  • 'Share' image -> they can select where to send image, including Files app

CodePudding user response:

This is not a programming question so it's technically off-topic for Stack Overflow. There is an option to "Add to Photos", which saves it into their Photos library and which is what most people would do. The option to download files, at least from Safari, is relatively new.

CodePudding user response:

It depends on the browser and it depends on how you are doing it.

If you are for instance downloading a file (that turns out to be an image) in Safari then that file will be downloaded into Files under downloads. You can select the file from your browser and use a "Share" functionality which opens a native dialog that shows all the applications that can accept this file type. Since it is an image one of the options will be to save it to photo library.

Still in Safari, if you long-press the image you will get a quick dialog with "Share...", "Add to photos" and "Copy".

In Chrome for instance long-pressing an image will show "Save Image", "Copy image", "Open image", "Open Image in New Tab", "Search Google for This Image" (And yes, sometimes "images" is capitalized and sometimes not :D). So you can clearly see that this "shortcut" menu really depends on the browser. There is no guarantee what user will get. A note here is that when selecting to save into camera roll ("Save Image" in this case) user may get a popup to give Chrome access to photos.

When I download a file in Chrome it just jumps to a preview. I assume that file is downloaded inside the application sandbox itself. I can not find it in "Files" app. I can however again "move" it from here. I can press "Downloads" which opens "Files" selector where I can select folder in which to download the image. Or I can long-press the image in preview and have the same list of options as described on previous paragraph.

So to answer your question(s)...

  • No, that unfortunately does not sound right. There is no telling where the downloaded file will end
  • No, you can not by any means force the image to end up in camera roll. And even if you did, your browser would need access to say the least.

And also there is no guarantee these paths will be or are preserved through OS versions or application versions or even device types...

  • Related