26

I am having download feature in my application. Here we can download multiple file as well. I am getting this error - **Failed to load resource:Frame load interrupted in Safari browser while downloading multiple files**

The issue is Only in safari. the download works fine in other browsers(Firefox, Chrome and IE).

I am using anchor tag to download .how to download file using anchor tag <a>

Community
  • 1
  • 1
Jeevitha G
  • 1,194
  • 3
  • 13
  • 20
  • 1
    Possible duplicate of: http://stackoverflow.com/questions/18652750/any-fallback-client-side-solutions-for-the-html5-download-attribute the `download` attribute is not supported in Safari. You should fix this on the backend anyways, having the application send a file properly instead of a text response. – mz3 Mar 25 '15 at 17:54

4 Answers4

3

I had the same issue with Safari In my case I am creating a svg file and then converts it to a pdf file that's the file I'm downloading it works in other browsers (firefox, chrome) except for safari. (I didn't check this on IE)

The problem with my code was there was missing 'xmlns=http://www.w3.org/2000/svg' attribute in the svg tag this fixed my problem hope this helps you

Tharindu
  • 640
  • 6
  • 17
2

The anchor tag download attribute does not work in Safari. I am not sure if this error you are getting is related but the download will not work in Safari regardless.

Source http://www.w3schools.com/tags/att_a_download.asp

You can try this jQuery plugin, which allows you to download files through javascript. I tested it and it seems to work in Chrome and Safari and is tested on all the other major browsers.

Jon Doe
  • 2,172
  • 1
  • 18
  • 35
  • Hi, Am also facing same kind of issue. I want to save base64 string (it may be csv or pdf) as a file at client side in safari. No servers included. Is it possible with jQuery.filedownload.js ? – jrh Dec 08 '15 at 14:06
  • @jrhamza: I face the same issue you mentioned. Have you resolved it ? – Selvakumar Ponnusamy May 24 '16 at 08:29
  • @Selvakumar, we used pdfmake.js library for this.(http://pdfmake.org). And for Safari we used open() method from the library. – jrh May 24 '16 at 09:26
0

I hope this will help. I had the same download issue on Safari with my NodeJS App. This is not a real issue, nor an issue with Safari. Safari was in my case just doing it job.

Explaination

Step #1: When you have an HTTP link (<a></a>), and you click on it, what is going to happen is a regular HTTP GET request sent to your server (NodeJS, Nginx or Apache).

Step #2: Then, your backend will serve the Response with your attachment. I will assume that you have done everything properly regarding the headers; content-type, content-disposition, content-content-length.

Step #3: The browser then receives the response and treat it how it should: I asked for a HTTP Request, I am expecting a HTTP Response.

The thing in NodeJS, is that if you do not send a response.end() you will get a Failed to load resource: Frame load interrupted. At the same time, if you do send a response.end() with or without content, it will replace the content of the page you are triggered the request from.

Solution What I have found that worked for me was to send in Step #1 a XML HTTP GET request, meaning AJAX request, instead of the regular HTTP GET. This way, the action is being treated in background as a XMLRequest: {'X-Requested-With': 'XMLHttpRequest'}.

To implement this, you can do it by hand or use a framework like jQuery.

-2

got the same error like above while using an ios cloud app

Solution that worked for me

Install Mozilla firefox from App Store login into webpage for the cloud app using firefox . Worked perfectly

leonidaa
  • 392
  • 1
  • 7
  • 12