Spring Excel Download returning random data in file

This question already has an answer here:

  • What is a correct mime type for docx, pptx etc? 4 answers

  • 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

    上一篇: 如何使pdf,xlsx和txt文件android的intent.setType?

    下一篇: Spring Excel下载文件中返回的随机数据