getgrav / getgrav/grav-plugin-admin

Attaching CSV File to Page Throws Mime Type Error

Open
#2,242 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.