how to download file? #1149

Closed
opened 2018-06-21 02:22:50 +00:00 by wvicioso · 3 comments
wvicioso commented 2018-06-21 02:22:50 +00:00 (Migrated from github.com)

The docs are pretty messy. All I want to do is generate an xlsx file and then give the user the option to download the new file to their computer.

I am using angular. I already can generate the file. I need help with the downloading part.

The docs are pretty messy. All I want to do is generate an xlsx file and then give the user the option to download the new file to their computer. I am using angular. I already can generate the file. I need help with the downloading part.
SheetJSDev commented 2018-06-21 04:22:23 +00:00 (Migrated from github.com)

https://docs.sheetjs.com/#writing-functions

XLSX.writeFile(wb, filename, write_opts) attempts to write wb to filename. In browser-based environments, it will attempt to force a client-side download.

The angular demo has an example of generating a file and triggering a download: https://github.com/SheetJS/js-xlsx/blob/master/demos/angular/SheetJS-angular.js#L18

https://docs.sheetjs.com/#writing-functions > `XLSX.writeFile(wb, filename, write_opts)` attempts to write `wb` to `filename`. In browser-based environments, it will attempt to force a client-side download. The angular demo has an example of generating a file and triggering a download: https://github.com/SheetJS/js-xlsx/blob/master/demos/angular/SheetJS-angular.js#L18
wvicioso commented 2018-06-21 21:29:31 +00:00 (Migrated from github.com)

Is there an example with angular 2+? @SheetJSDev

Is there an example with angular 2+? @SheetJSDev
SheetJSDev commented 2018-06-21 21:31:21 +00:00 (Migrated from github.com)

https://github.com/SheetJS/js-xlsx/tree/master/demos/angular2 includes examples of a plain angular 2+ app as well as ionic and nativescript targets

https://github.com/SheetJS/js-xlsx/tree/master/demos/angular2 includes examples of a plain angular 2+ app as well as ionic and nativescript targets
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#1149
No description provided.