-
-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert the base64 encoded data to a Blob to allow for exports of larger tables #48
Conversation
Signed-off-by: Blagoj Atanasovski <blagoj.atanasovski@sorsix.com>
…ore assigned to the href of the anchor
I had a similar solution in #44 but this looks slightly more robust. |
How about adding the msSaveBlob to add IE support, now you've got the heavy lifting to use blobs |
Thanks for the comment, I just saw your code, I'll try to combine it with these changes, but i'll have to set up my windows env first 😄 i'm running linux currently |
As seen in the pull request #44 or user @craignicol
Just tested it myself, works on Chrome, IE and Edge, but not Firefox gives me I used |
@@ -167,18 +168,32 @@ ExcellentExport = (function() { | |||
return data; | |||
}; | |||
|
|||
function createDownloadLink(anchor, base64data, exporttype, filename){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firefox requires the export type to be of the format "{type: exporttype}"
Merged the pull request. Thanks @atanasovskib !! It had some conflicts but works great. |
The Firefox error persists in the 2.0.0 version (downloaded today) for Firefox 49.0.1 when using the CSV export. |
The problem
The current implementation encodes the tables in base64 and creates a download href. But this approach has a limit on how large can the base64 data be for the browser to be able to download/create the file.
Where it failed
I had trouble exporting >10000 rows with 2 columns only
The solution
A Blob object is created from the base64 encoded data, and a the anchor href is just a reference to that blob object. The explanation is taken from a stack overflow comment