Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

MP3 file upload: "The mime type does not match to file extension"

admin

Started by Vladimir Novak 5 years ago · 2 replies · 2697 views
5 years ago

Hi all Grav webmasters and developers!

The Grav version is 1.7. Web browser is Mozilla Firefox 89.0 (x64) under Linux Mint.

When I tried to upload MP3 file to my blog page in Admin mode,
I got error "The mime type does not match to file extension"

The solution of the problem is to edit file /system/config/media.yaml:

mp3:
type: audio
thumb: media/thumb-mp3.png
mime: audio/mp3

change to

mp3:
type: audio
thumb: media/thumb-mp3.png
mime: audio/mpeg

And then upload file MP3 again.

Bottom line: the right MIME type for *.MP3 files should be audio/mpeg, not audio/mp3.

👍 1
last edited 06/11/21 by Vladimir Novak
5 years ago

@vlad73, Not my field of expertise, but you might be right...

According to MDN on Common MIME types:

Extension Kind of document MIME Type
.mp3 MP3 audio audio/mpeg

You might consider creating an issue to github.com/getgrav/grav

5 years ago

@vlad73:
audio/mpeg

Works, thanks for posting this 🙂

Suggested topics

Topic Participants Replies Views Activity
General · by lynbor, 3 weeks ago
3 352 3 days ago
General · by lynbor, 1 week ago
7 387 3 days ago
General · by Harry, 3 days ago
0 83 3 days ago
General · by Old Man Umby, 3 weeks ago
2 256 2 weeks ago
General · by jeremycherfas, 3 weeks ago
5 374 2 weeks ago