Backend converts the xls file into base64 String and returns in the http response.On the browser, any way to convert it back to xls for downloading?
Asked
Active
Viewed 213 times
-3
-
https://stackoverflow.com/questions/2820249/base64-encoding-and-decoding-in-client-side-javascript – Merlyn007 Aug 14 '17 at 04:03
-
11. what's the purpose of this conversion on server side? 2. yes, you can make this reverse-conversion, please read https://stackoverflow.com/questions/16245767/creating-a-blob-from-a-base64-string-in-javascript – tibetty Aug 14 '17 at 04:04
-
2k reputation and you didn't research before submitting your question.... if you did research then why is it I can find so many questions like this with answers.... No attempt(s) of your own included in your question too.... – NewToJS Aug 14 '17 at 04:10
-
1@NewToJS Pls focus on the question/answer rather than finger pointing. learn from the rest of the responders. – Hammer Aug 14 '17 at 04:17
-
@Hammer Learn how to submit an acceptable question and you won't have anyone pointing fingers.... start with research or explain/show what you have tried within your question and explain why it isn't functioning as intended. If people were to just focus on the question and give answers you will end up with so many duplicates which Stack Overflow clearly wants to avoid hence the flagging option and related suggestions. – NewToJS Aug 14 '17 at 04:23
1 Answers
1
It is not necessary to convert the base64
string any further. Add the necessary portions to base64
string to form a valid data URI
, then proceed to offer file for download.
const mime = "data:application/vnd.ms-excel,";
const data = mime + base64string;

guest271314
- 1
- 15
- 104
- 177