getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 227 forks source link

Attaching CSV File to Page Throws Mime Type Error #2242

Open thekenshow opened 2 years ago

thekenshow commented 2 years ago

I have a client that edits their data in Excel, exports to CSV, and uploads to a Grav page (default dropzone). After upgrading to 1.7.30, they started getting the following error when uploading the CSV:

An error occurred while trying to upload the file EV ZX All Parts REV 2.csv. The mime type does not match to file extension`.

The issue was resolved by copying system/mime.yaml to user/config/mime.yaml (thanks, @mahagr!) and editing the CSV mime type as follows:

  csv:
  - text/csv
  - application/vnd.ms-excel

The Excel->CSV workflow is pretty common, so system/mime.yaml should be modified to include MS's vendor-specific mime type.