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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

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

admin

Started by Vladimir Novak 5 years ago · 2 replies · 1998 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 Jerry Hunt, 4 days ago
2 99 15 hours ago
General · by pamtbaau, 21 hours ago
1 63 20 hours ago
General · by Andy Miller, 1 day ago
0 48 1 day ago
General · by Marcel, 12 months ago
6 357 5 days ago
General · by Duc , 6 days ago
3 45 6 days ago