Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

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

admin

Started by Vladimir Novak 5 years ago · 2 replies · 2517 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 jean-louis67, 2 weeks ago
2 216 1 week ago
General · by Andy Miller, 2 weeks ago
0 232 2 weeks ago
General · by Veehem, 2 weeks ago
0 219 2 weeks ago
General · by milkboy, 2 weeks ago
0 216 2 weeks ago
General · by ian russell, 3 weeks ago
2 297 3 weeks ago