qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
17.62k stars 1.68k forks source link

File is missing media type #1889

Closed barlevd closed 2 months ago

barlevd commented 2 months ago

File are missing Excel media properties

Steps to reproduce the issue:

  1. Create a new file, or update and exiting one
  2. Export the data and save to your local computer
  3. In linux / Mac OS, with the file tool file --mime-type file.xlsx, it reports file.xlsx: application/octet-stream

Describe the results you received:

Describe the results you expected:

file --mime-type file.xlsx
file.xlsx: application/octet-stream

The output should be

file.xlsx: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Output of go version:

go version go1.22.1 darwin/amd64

Excelize version or commit ID:

(paste here)

Environment details (OS, Microsoft Excel™ version, physical, etc.):

The fix is to change the sort order of the output zip file.

xuri commented 2 months ago

Thanks for issue. I have merged the pull request. Please upgrade to the master branch code, and this patch will be released in the next version.

barlevd commented 2 months ago

Thank you for the fast follow up.