Vue + element ui cannot open Excel after downloading it

byte Stream

element ui

download

excel

We now have a requirement: upload a file at the front end, return a new byte stream to the front end under file processing at the back end, and then download it directly.
question: an error is displayed after downloading Excel. Does anyone know how to solve this problem, or where is the setting wrong? Thank you very much!

Excel 2007 template is used in the back end, and Excel 2007 is also used when downloading and opening the front end

PS: cannot be downloaded by returning url download for the time being due to system limitations.

May.22,2021

suspects that the excel generated by the backend will not open itself.
it is recommended that the backend do not return the stream to the front end, just generate the excel file and put it in a temporary directory, and open it to see if the generated excel can be opened.
if it can be opened, the problem occurs when the transmission and the browser receives the stream to generate the excel file; if it cannot be opened, there is something wrong with the excel you generated.


this problem is that there is a problem with the excel file generated by the backend.
it is recommended that the backend check the problem


. The original Blob object is to be built with Object.data, which was written incorrectly before.
the correct code should be:
let url = window.URL.createObjectURL (new Blob ([res.data])

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e471b1-44449.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e471b1-44449.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?