Check this:
https://github.com/eligrey/FileSaver.js[
^]
Excerpt from github:
FileSaver.js implements the HTML5 W3C saveAs() FileSaver interface in browsers that do not natively support it. There is a FileSaver.js demo 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 for a cross-browser implementation.