Filesaver.js: Safari : Failed to load resource: Frame load interrupted

Created on 19 Apr 2016  ·  18Comments  ·  Source: eligrey/FileSaver.js

_OSx: 10.11.3 (15D21)
Safari: Version 9.0.3 (11601.4.4)_

If I want to download something as a file, my browser console logs:

_Failed to load resource: Frame load interrupted_

It looks like your demo (https://eligrey.com/demos/FileSaver.js/ --> Saving rich text) has the
same issue.

bug safari

Most helpful comment

This is consistently reproducible for me in Safari 10 on El Capitan.
screen shot 2016-10-17 at 11 42 14 pm

Also, the first two demos on https://eligrey.com/demos/FileSaver.js doesn't don't work correctly (they open the files in new tabs), and the last demo doesn't work at all (it briefly opens and closes a tab).

Edit: Just noticed your suggested workarounds with the content types @jimmywarting; those are working as described for me. Thanks!

All 18 comments

Can take a crack at this later today, I have summarized a pretty good explanation as to why you see this message and how to avoid it in #12

@eligrey I fixed the demo so Safari doesn't throw any more errors. I had two options
either use {type: "text/plain"} or {type: "application/octet-stream"}

  • Text/plain will make safari render the page as raw text in a new tab
  • application/octet-stream will make safari download the file but the name will be Unknown

I thought it would be better if Safari is capitabel of rendering the raw data and then let the user save the file manually with cmd+s to save it so they can get a decent filename without unknown extension

But the demo has to be updated, don't know how to update the website...

This bug can be closed once the demo is updated.
If you guys need further help with this then please follow up in #12

@jimmywarting I don't think this ticket should be closed. I am trying to download a zip file. It is not really an option to

  • save the content as file "Unknown"
  • display binary content in Safari and then expect the user to know that this is a ZIP file that must be saved with .zip extension

I cannot judge whether this is a Safari issue rather than a FileSaver.js one, but if it _can_ be addressed here that would be fantastic.

@thomasbee There isn't any fix to solve the filename issue in Safari except for waiting until the next release (as described in #12)
And if the filename is that important then your only option today is to use flash and downloadify also mention in #12

This is consistently reproducible for me in Safari 10 on El Capitan.
screen shot 2016-10-17 at 11 42 14 pm

Also, the first two demos on https://eligrey.com/demos/FileSaver.js doesn't don't work correctly (they open the files in new tabs), and the last demo doesn't work at all (it briefly opens and closes a tab).

Edit: Just noticed your suggested workarounds with the content types @jimmywarting; those are working as described for me. Thanks!

Everything works fine in Safari Technology Preview (WebKit 12603.1.16).

@dsego Good find. Looks like the Release 16 back on 26 Oct (current preview release is number 20) now allows specifying the name:

Changed “Download Linked File” context menu action to use the value of the download attribute as the filename

Now just a matter of waiting on Apple to implement in Safari, and then for it to distribute... So just a year or two 🙄

Can we construct a File and use that?

var file = new File([parts], 'filename')
var url = URL.cretateObjectURL(file)
var link = document.createElement('a')
link.href = url
link.click()

I am still seeing issue in Safari. It downloads the file as "Unknown (No extension) [Problem #1)
but in log window it also show a very long text with Failed to load resource: Frame load interrupted errorr [Problem #2]

Any help please?

Yes i'm having the same issue also. The file is been downloaded as Unknown with errors

Same issue here. Working in chrome but safari throws "Failed to load resource: Frame load interrupted"

Also seeing the same issue. Works in Chrome, Firefox, IE11, but not Safari. Throws "Failed to load resource: Frame load interrupted"

Same happening here. Happening with Safari 10.0.1 but not with latest 10.1.1. Anyone knows why?

In Safari 10.1 Apple had finally implemented the 'download' attribute.
So now everything should work just like other browsers

@doronsever whas it because of that? Are you sure? Can you post some more insights on that issue here? Thanks!

@doronsever thanks a lot! then all clear. This issue should be closed, I guess.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

strobec picture strobec  ·  4Comments

danielbronder picture danielbronder  ·  6Comments

ezequiel88 picture ezequiel88  ·  4Comments

binishprabhakar picture binishprabhakar  ·  6Comments

Toterbiber picture Toterbiber  ·  5Comments