Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
Download an image from a webapp directly to the Photo Library with JavaScript

TL;DR Is there a way to download a content from a webapp directly to the mobile's Photo Library?

I have been looking for a way to share an image from my webapp to Instagram. I followed this great comment and tried to implement it.

For me, instagram-stories://share doesn't work (sometimes it opens the editing page and sometimes it doesn't) but I was able to use instagram://library?AssetPath="" - this link opens the "post to instagram" page and takes the last photo you have on your Photo Library.

So I am triggering a download function to download the image to the user device

const generate = async (url) => {
        const image = await fetch(url);
        const imageBlob = await image.blob();
        const imageURL = URL.createObjectURL(imageBlob);
        const link = document.createElement('a');
        link.href = imageURL;
        link.download = 'file-name';
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
    };

but it seems like it downloads it to the Download folder (on iPhone IOS 15.5). Then I need to manually save it to the Photo Library - is there a way to download a content from a webapp directly to the Photo Library?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!