Jawsh's avatar

Symfony / Laravel routinely rejecting audio files for being BIN files when they are verifiably not

The mimetype guesser is completely smashed when it comes to audio. It's pretty bad with some filetypes, but with nothing is it as bad as audio. It's not just that Google Music (where I get my songs) is doing wrong, because other people are having the same problems with music from all sorts of sources.

Try uploading this file into Laravel and see how it processes it.
http://jaw.sh/05%20Hip%20To%20Be%20Square.mp3

The mime type is apparently "application/octet-stream" and it also fails the mime validator because it thinks it's a .bin. This music file has proper ID3 meta tagging, plays in any normal MP3 player, etc. Laravel usually only applies that mime type when file upload size constraints cut off a POST request, but I am 100% sure it's just reading the file wrong.

I don't even know where I'd start in sidestepping this problem. I need validation and I need to accept these files.

0 likes
1 reply

Please or to participate in this conversation.