getgrav / getgrav/grav-plugin-admin

Error with SVG and file field with mime-type accept svg+xml

Open
#1,725 1 comment 0 reactions 1 assignee Claimed by @rhukster View on GitHub
bug evaluating
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

I have configured a plugin with a file upload field as follows:

```
type: file
...
multiple: true
limit: 0
filesize: 1
accept:
- image/svg+xml
```

When uploading an SVG to that file field, I receive the following error:
```
The MIME type "image/svg+xml" for the file "abacus.svg" is not an accepted.
```
![Error displayed when uploading SVG](https://user-images.githubusercontent.com/19746208/61788796-ea943c00-ae0a-11e9-9e0b-7cb02339f34d.png)

The SVG mime-type appears to be accurately defined in the media section of my site configuration (all are left as default):
![Media configuration for svg](https://user-images.githubusercontent.com/19746208/61788794-ea943c00-ae0a-11e9-9b36-a0e70764d803.png)

However, when I set the `accept` to `image/*`, the image upload works perfectly fine with the same SVG files. (The SVGs in question are Font Awesome Pro icons, in case that makes any difference).

**Version:**
- Grav: 1.6.11
- Grav Admin: 1.9.7

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.