Question for the programming geeks re. mp3 MIME types

ok, so I'm building an app that requires upload of mp3 files

I'm performing my validations of the uploaded mp3, to make sure it's of the right mime type.

Problem is, I"m testing it with mp3's on my computer, and i'm getting some weird results. All the mp3's I've tried have failed the validation, and I'm stepping through the app and debugging, and checking out the MIME types of the uploaded files, and for every mp3 I'm getting 'application/force-download'

can anyone shed any light on this MIME type?... from what I've read, it's got something to do with forcing the browser to download these files, but why is it showing this for all of my mp3's?, even the ones that I didn't download... Is there a way around this?, or would it be best to just include this in the validations as a valid MIME type...

cheers
 
The mime type isn't contained in the mp3. The mime type is a setting on the server.

root@*****:~# cat /etc/mime.types | grep mp3
audio/mpeg mpga mpega mp2 mp3 m4a

Is this what you are looking for?
 
not really, i'm more looking at the file content types

sorry, I might have gotten my words mixed up a bit there... It might have something to do with my local server interpreting the files as something other than 'application/mp3', or any of the other file content types associated with mp3.

I will investigate further.

cheers
 
Looks to me like, you would use a 'descriptive' MIME type like audio/mp3 or whatever if you intend the browser to handle the request the way it's been configured. Some may play this data, in whichever plugin, maybe externally, or maybe open a save as dialog. So, if you wanted to force them to save it, you don't tell their browser what type of data it is. I normally use application/octet-stream for this purpose. 'application/force-download' is new to me. Perhaps not all browsers are 'aware' of that one yet?

You can setup Apache to send whatever MIME type you want, for whatever file extension that you wish.

My two cents anyway, like.
 
well, I'm actually performing the validations on mp3's i'm uploading, just for testing purposes... I'm using the local server, but it's reading the files as 'application/force-download' ...
 
What's the "it" that's reading them as 'application/force-download'? You're uploading to a script, right? Via POST? Can't you set the mime type in the form:

Code:
 <form enctype="mimetype"> ... </form>
Or something, no?
 
EVENT GUIDE - HIGHLIGHT
Stand-up Comedy Club: Thursday Showcase
The Roundy, Castle St.

18th Jul 2024 @ 8:30 pm
More info..

Sprints

Coughlan's, Today @ 7:30pm

More events ▼
Top