Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda