Click here to Skip to main content
15,041,025 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to download multiple images and videos files on chrome and Firefox browsers of iPhone using javascript.
I get some solution in which they are creating a tag and setting all the necessary attributes and clicking on that is working but for me this solution is not working on iPhone browsers (Chrome and Firefox).
Below are the version of the browsers:
1- Chrome: 81.0.4044.124
2- Firefox: 28.1

What I have tried:

I tried the above solution but that is not working for me.
Posted
Updated 15-Sep-20 19:38pm
v2
Comments
Gerry Schmitz 15-Sep-20 9:38am
   
Did you ask in the Apple forums? What is an "Iphone Browser"? If you don't know, then that's your problem.
Member 14686752 16-Sep-20 2:31am
   
Yeah, I post this question there too. iPhone browsers mean (chrome, firefox, and safari browsers of iPhone), but my solution is working for safari and not working in chrome and firefox.

1 solution

If you're using the download attribute on an <a> element, then you'll need iOS Safari version 13 or later:
Can I use... Download attribute[^]

If you can't upgrade, then you'll need to use a server which can send the correct content-disposition headers to download the file.
   
Comments
Member 14686752 15-Sep-20 23:46pm
   
In Safari my solution is working, but the problem is coming in chrome and Firefox browsers of my iPhone.
Richard Deeming 16-Sep-20 4:18am
   
Are the files you're downloading served from the same site as the page you're downloading them from? If not, Firefox won't honour the download attribute.

The only way to achieve 100% browser compatibility is to have the server send a Content-Disposition: attachment header with the file.
Member 14686752 16-Sep-20 5:25am
   
yes, I am downloading from the same-origin and I tried with Content-Disposition too as you mentioned earlier.
If you see in my question, it is working in chrome and firefox browsers of my windows laptop and android phone, but only on iPhone, I am not able to download.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900