forked from fanruan/easyexcel
Browse Source
Raise the PR to fix the sample issue by incorrect content type. By given sample, we will get a xls type excel even set excelType(ExcelTypeEnum.XLSX), which will open with an alert even the file encoding is based on xlsx. "The file format and extension of 'xxx' don't match. The file could be corrupted of unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?" The root cause is from incorrect content type. it will be fine if set the content type based on xlsx as below response.setContentType("vnd.openxmlformats-officedocument.spreadsheetml.sheet") Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types .xls Microsoft Excel application/vnd.ms-excel .xlsx Microsoft Excel (OpenXML) application/vnd.openxmlformats-officedocument.spreadsheetml.sheetdeveloping
ian.zhang
4 years ago
committed by
GitHub
1 changed files with 2 additions and 2 deletions
Loading…
Reference in new issue