
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
angular-file-saver
Advanced tools
An AngularJS service that implements the HTML5 W3C saveAs() in browsers that do not natively support it
Angular File Saver is an AngularJS service that leverages FileSaver.js and Blob.js to implement the HTML5 W3C saveAs() interface in browsers that do not natively support it
File dist/angular-file-saver.bundle.js
contains all required dependencies and
grants access to both Blob.js
and FileSaver.js
polyfills via Blob
and
SaveAs
services.
# Using bower:
$ bower install angular-file-saver
# Using npm:
$ npm install angular-file-saver
ngFileSaver
module into your project;FileSaver
and Blob
services as dependencies;new Blob(['text'], { type: 'text/plain;charset=utf-8' })
;FileSaver.saveAs
with the following arguments:
data
Blob: a Blob instance;filename
String: a custom filename (an extension is optional);disableAutoBOM
Boolean: (optional) Disable automatically provided Unicode text encoding hints;FileSaver
A core Angular factory.
#saveAs(data, filename[, disableAutoBOM])
Immediately starts saving a file
data
: a Blob instance;filename
: a custom filename (an extension is optional);disableAutoBOM
: (optional) Disable automatically provided Unicode text encoding hints;Blob(blobParts[, options]))
An Angular factory that returns a Blob instance.
SaveAs(data, filename[, disableAutoBOM])
An Angular factory that returns a FileSaver.js polyfill.
JS
function ExampleCtrl(FileSaver, Blob) {
var vm = this;
vm.val = {
text: 'Hey ho lets go!'
};
vm.download = function(text) {
var data = new Blob([text], { type: 'text/plain;charset=utf-8' });
FileSaver.saveAs(data, 'text.txt');
};
}
angular
.module('fileSaverExample', ['ngFileSaver'])
.controller('ExampleCtrl', ['FileSaver', 'Blob', ExampleCtrl]);
HTML
<div class="wrapper" ng-controller="ExampleCtrl as vm">
<textarea
ng-model="vm.val.text"
name="textarea" rows="5" cols="20">
Hey ho let's go!
</textarea>
<a href="" class="btn btn-dark btn-small" ng-click="vm.download(vm.val.text)">
Download
</a>
</div>
MIT © Philipp Alferov
FAQs
An AngularJS service that implements the HTML5 W3C saveAs() in browsers that do not natively support it
The npm package angular-file-saver receives a total of 21,265 weekly downloads. As such, angular-file-saver popularity was classified as popular.
We found that angular-file-saver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.