FileSaver

Haxe externs for the FileSaver.js library (for saving files from the browser).


Keywords
js
License
MIT
Install
haxelib install FileSaver 1.0.0

Documentation

haxe-FileSaver

License

Haxe externs for eligrey/FileSaver.js

Supported browsers

From eligrey/FileSaver.js#supported-browsers:

Browser Constructs as Filenames Max Blob Size Dependencies
Firefox 20+ Blob Yes 800 MiB None
Firefox < 20 data: URI No n/a Blob.js
Chrome Blob Yes 500 MiB None
Chrome for Android Blob Yes 500 MiB None
IE 10+ Blob Yes 600 MiB None
Opera 15+ Blob Yes 500 MiB None
Opera < 15 data: URI No n/a Blob.js
Safari 6.1+* Blob No ? None
Safari < 6 data: URI No n/a Blob.js

Syntax

FileSaver.saveAs(blob:js.html.Blob, fileName:String, disableAutoBOM:Bool = false);

Examples

Saving text

var blob:js.html.Blob = new js.html.Blob(["Hello world!"], { type: "text/plain;charset=utf-8" });
FileSaver.saveAs(blob, "hello world.txt");

Live Sample

A live sample is available, which provides you with a poem!