AlaSQL / alasql

AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
http://alasql.org
MIT License
7.01k stars 653 forks source link

Angular.js + AlaSQL on Safari #500

Closed paulmaclean closed 8 years ago

paulmaclean commented 8 years ago

Thank you for the great work on AlaSQL, it has made my life easy for exporting angular scope variables to xls.

I am utilizing the technique found here : https://github.com/agershun/alasql/wiki/Angular.js, but I have run into a bit of snag. My client is using the export feature on Safari but it throws an error. Same error occurs on the example fiddle (http://jsfiddle.net/agershun/00nfeq12/)

I have added two scripts (https://github.com/SheetJS/js-xls/blob/master/shim.js & https://github.com/eligrey/Blob.js/) that removes the error, however on exporting , Safari now opens in a new window with a data:text/plain encoding

Any help would be greatly appreciated.

mathiasrw commented 8 years ago

Its one of the oldest unresolved issues: https://github.com/agershun/alasql/issues/27

In short: safari limits you from downloading generated files thats not plain text. If you can use .csv that will solve the problem...