ioshttpdownloadcamera-rollfiles-app

When a user on an iPhone downloads a JPG file from my site, is it possible to direct that file to end up in their camera roll?


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


Solution

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

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