PHPackages                             intelogie/filesaver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. intelogie/filesaver

ActiveLibrary[File &amp; Storage](/categories/file-storage)

intelogie/filesaver
===================

0146

Since Jul 1Compare

[ Source](https://github.com/INTELOGIE/FileSaver.js)[ Packagist](https://packagist.org/packages/intelogie/filesaver)[ RSS](/packages/intelogie-filesaver/feed)WikiDiscussions Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

If you need to save really large files bigger then the blob's size limitation or don't have enough RAM, then have a look at the more advanced [StreamSaver.js](https://github.com/jimmywarting/StreamSaver.js)that can save data directly to the hard drive asynchronously with the power of the new streams API. That will have support for progress, cancelation and knowing when it's done writing

FileSaver.js
============

[](#filesaverjs)

FileSaver.js implements the `saveAs()` FileSaver interface in browsers that do not natively support it. There is a [FileSaver.js demo](http://eligrey.com/demos/FileSaver.js/) that demonstrates saving various media types.

FileSaver.js is the solution to saving files on the client-side, and is perfect for webapps that need to generate files, or for saving sensitive information that shouldn't be sent to an external server.

Looking for `canvas.toBlob()` for saving canvases? Check out [canvas-toBlob.js](https://github.com/eligrey/canvas-toBlob.js) for a cross-browser implementation.

Supported browsers
------------------

[](#supported-browsers)

BrowserConstructs asFilenamesMax Blob SizeDependenciesFirefox 20+BlobYes800 MiBNoneFirefox &lt; 20data: URINon/a[Blob.js](https://github.com/eligrey/Blob.js)ChromeBlobYes[500 MiB](https://code.google.com/p/chromium/issues/detail?id=375297)NoneChrome for AndroidBlobYes[500 MiB](https://code.google.com/p/chromium/issues/detail?id=375297)NoneEdgeBlobYes?NoneIE 10+BlobYes600 MiBNoneOpera 15+BlobYes500 MiBNoneOpera &lt; 15data: URINon/a[Blob.js](https://github.com/eligrey/Blob.js)Safari 6.1+\*BlobNo?NoneSafari &lt; 6data: URINon/a[Blob.js](https://github.com/eligrey/Blob.js)Feature detection is possible:

```
try {
    var isFileSaverSupported = !!new Blob;
} catch (e) {}
```

### IE &lt; 10

[](#ie--10)

It is possible to save text files in IE &lt; 10 without Flash-based polyfills. See [ChenWenBrian and koffsyrup's `saveTextAs()`](https://github.com/koffsyrup/FileSaver.js#examples) for more details.

### Safari 6.1+

[](#safari-61)

Blobs may be opened instead of saved sometimes—you may have to direct your Safari users to manually press ⌘+S to save the file after it is opened. Using the `application/octet-stream` MIME type to force downloads [can cause issues in Safari](https://github.com/eligrey/FileSaver.js/issues/12#issuecomment-47247096).

### iOS

[](#ios)

saveAs must be run within a user interaction event such as onTouchDown or onClick; setTimeout will prevent saveAs from triggering. Due to restrictions in iOS saveAs opens in a new window instead of downloading, if you want this fixed please [tell Apple](https://bugs.webkit.org/show_bug.cgi?id=102914) how this bug is affecting you.

Syntax
------

[](#syntax)

```
FileSaver saveAs(Blob/File data, optional DOMString filename, optional Boolean disableAutoBOM)
```

Pass `true` for `disableAutoBOM` if you don't want FileSaver.js to automatically provide Unicode text encoding hints (see: [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark)).

Examples
--------

[](#examples)

### Saving text

[](#saving-text)

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

The standard W3C File API [`Blob`](https://developer.mozilla.org/en-US/docs/DOM/Blob) interface is not available in all browsers. [Blob.js](https://github.com/eligrey/Blob.js) is a cross-browser `Blob` implementation that solves this.

### Saving a canvas

[](#saving-a-canvas)

```
var canvas = document.getElementById("my-canvas"), ctx = canvas.getContext("2d");
// draw to canvas...
canvas.toBlob(function(blob) {
    saveAs(blob, "pretty image.png");
});
```

Note: The standard HTML5 `canvas.toBlob()` method is not available in all browsers. [canvas-toBlob.js](https://github.com/eligrey/canvas-toBlob.js) is a cross-browser `canvas.toBlob()` that polyfills this.

### Saving File

[](#saving-file)

You can save a File constructor without specifying a filename. The File itself already contains a name, There is a hand full of ways to get a file instance (from storage, file input, new constructor) But if you still want to change the name, then you can change it in the 2nd argument

```
var file = new File(["Hello, world!"], "hello world.txt", {type: "text/plain;charset=utf-8"});
saveAs(file);
```

[![Tracking image](https://camo.githubusercontent.com/3eecdcc8e4e3b43f6035d8f4e9c1610a4e30afc858cde67534eb237401304db9/68747470733a2f2f696e2e676574636c69636b792e636f6d2f3231323731326e732e676966)](https://camo.githubusercontent.com/3eecdcc8e4e3b43f6035d8f4e9c1610a4e30afc858cde67534eb237401304db9/68747470733a2f2f696e2e676574636c69636b792e636f6d2f3231323731326e732e676966)

Contributing
------------

[](#contributing)

The `FileSaver.js` distribution file is compiled with Uglify.js like so:

```
uglifyjs FileSaver.js --mangle --comments /@source/ > FileSaver.min.js
# or simply:
npm run build
```

Please make sure you build a production version before submitting a pull request.

Installation
------------

[](#installation)

```
npm install file-saver --save
bower install file-saver
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cd960536c07e255b2e6f7e55c03c6d09274b215ccceaccc38926ffe03e098a7?d=identicon)[bgauthier](/maintainers/bgauthier)

---

Top Contributors

[![eligrey](https://avatars.githubusercontent.com/u/46995?v=4)](https://github.com/eligrey "eligrey (149 commits)")[![jimmywarting](https://avatars.githubusercontent.com/u/1148376?v=4)](https://github.com/jimmywarting "jimmywarting (21 commits)")[![XhmikosR](https://avatars.githubusercontent.com/u/349621?v=4)](https://github.com/XhmikosR "XhmikosR (4 commits)")[![mudcube](https://avatars.githubusercontent.com/u/101564?v=4)](https://github.com/mudcube "mudcube (4 commits)")[![minj](https://avatars.githubusercontent.com/u/1035523?v=4)](https://github.com/minj "minj (3 commits)")[![blakeembrey](https://avatars.githubusercontent.com/u/1088987?v=4)](https://github.com/blakeembrey "blakeembrey (3 commits)")[![Jimbly](https://avatars.githubusercontent.com/u/774383?v=4)](https://github.com/Jimbly "Jimbly (2 commits)")[![evilaliv3](https://avatars.githubusercontent.com/u/217034?v=4)](https://github.com/evilaliv3 "evilaliv3 (2 commits)")[![floriangouy](https://avatars.githubusercontent.com/u/1767167?v=4)](https://github.com/floriangouy "floriangouy (2 commits)")[![jordanaustin](https://avatars.githubusercontent.com/u/709038?v=4)](https://github.com/jordanaustin "jordanaustin (2 commits)")[![chilijung](https://avatars.githubusercontent.com/u/1216029?v=4)](https://github.com/chilijung "chilijung (2 commits)")[![ph4r05](https://avatars.githubusercontent.com/u/1052761?v=4)](https://github.com/ph4r05 "ph4r05 (1 commits)")[![sjurba](https://avatars.githubusercontent.com/u/1729935?v=4)](https://github.com/sjurba "sjurba (1 commits)")[![tmcw](https://avatars.githubusercontent.com/u/32314?v=4)](https://github.com/tmcw "tmcw (1 commits)")[![treygriffith](https://avatars.githubusercontent.com/u/1371533?v=4)](https://github.com/treygriffith "treygriffith (1 commits)")[![josh-dykstra](https://avatars.githubusercontent.com/u/5152427?v=4)](https://github.com/josh-dykstra "josh-dykstra (1 commits)")[![bgauthier](https://avatars.githubusercontent.com/u/1789355?v=4)](https://github.com/bgauthier "bgauthier (1 commits)")[![eugene-ku](https://avatars.githubusercontent.com/u/7567629?v=4)](https://github.com/eugene-ku "eugene-ku (1 commits)")[![Hypercubed](https://avatars.githubusercontent.com/u/509946?v=4)](https://github.com/Hypercubed "Hypercubed (1 commits)")[![jjuutila](https://avatars.githubusercontent.com/u/435263?v=4)](https://github.com/jjuutila "jjuutila (1 commits)")

### Embed Badge

![Health badge](/badges/intelogie-filesaver/health.svg)

```
[![Health](https://phpackages.com/badges/intelogie-filesaver/health.svg)](https://phpackages.com/packages/intelogie-filesaver)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
