Spring Excel Download returning random data in file
This question already has an answer here:
I think this is not application/xls
but rather
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
as seen in this answer.
EDIT
The syntax of the Content-Disposition
header is incorrect: The filename should be in double quotes.
response.setHeader("Content-Disposition","attachment; filename=""+ accountNumber+ ".xlsx"");
链接地址: http://www.djcxy.com/p/45440.html