Content-Type handling

Discussion of general topics about Mozilla Firefox
Post Reply
User avatar
spark
Posts: 327
Joined: November 6th, 2002, 9:28 am
Location: UK

Content-Type handling

Post by spark »

Hi,

If you go to http://www.one-trak-mind.com/audio.html and click on one of the audio links (eg the top one), Phoenix trys to open the file internally (the file is a WMA file so it just displays reams of garbage). If I do the same in IE6, Windows Media Player opens and plays the file.

I presume this is something to do with the Content-Type for WMA files not being set correctly on the server (is this right?). My question is, is there any way to tell Phoenix "use this Content-Type instead" (i tryed <a href=".." type="content-type"> but it doesn't seem to do anything).

Many thanks,

-spark

PS: The hosts aren't responding to my email -- we're moving hosts in January, but until then... (Anyone suggest a good cheap host?! :o)
Ted Mielczarek
Posts: 1269
Joined: November 5th, 2002, 7:32 am
Location: PA
Contact:

Content-Type

Post by Ted Mielczarek »

If you have access to the server, and it's running Apache, you can change the content type in a .htaccess file. For an example, making the server handle XPI files correctly can be done by putting:

AddType application/x-xpinstall .xpi

in a .htaccess file. To make it handle other types, you just need to know the MIME type and the file extension, and put them in like that. The reason those links work in IE is because IE will determine filetype based on other things, which is not really the right thing to do. Content type is set by the server, the browser should follow it accordingly.
User avatar
spark
Posts: 327
Joined: November 6th, 2002, 9:28 am
Location: UK

Post by spark »

Excellent! I'll try that! Cheers for the reply!

-spark
seb
Posts: 1578
Joined: November 4th, 2002, 11:26 pm
Location: Paris, France
Contact:

Post by seb »

If you're wondering, MIME type for WMA is audio/x-ms-wma
(Taken from http://msdn.microsoft.com/library/defau ... l/mime.asp)
So, adding the following in a .htaccess file should work
AddType audio/x-ms-wma .wma
User avatar
spark
Posts: 327
Joined: November 6th, 2002, 9:28 am
Location: UK

Post by spark »

"550 .htaccess: Forbidden filename"

Any way round this? I guess not :o( God damn host.....

Thanks for your help anyway peeps!

-spark
User avatar
lah
Posts: 23
Joined: November 5th, 2002, 9:05 am

Post by lah »

This is a place where the standards confuses me... what is the point in being able to specify contet-type on a link, if <b>not</b> for overiding the servers content-type? Anyone can clue me in?

It would be <b>realy</b> usefull... specify a text/plain link to a html file to show it's source for instanse.

/LaH
User avatar
laszlo
Posts: 5225
Joined: November 4th, 2002, 6:13 pm
Location: .de
Contact:

Post by laszlo »

lah wrote:This is a place where the standards confuses me... what is the point in being able to specify contet-type on a link, if <b>not</b> for overiding the servers content-type? Anyone can clue me in?

It's there to let the user agent decide if it makes sense to download the provided link. If it doesn't support the content type it can save bandwidth by simply ignoring it.
User avatar
lah
Posts: 23
Joined: November 5th, 2002, 9:05 am

Post by lah »

laszlo wrote:It's there to let the user agent decide if it makes sense to download the provided link. If it doesn't support the content type it can save bandwidth by simply ignoring it.


It's an explanasion but I still think the standard is silly in this aspect... but that don't mean I am arguing for breaking the standard :-)

/LaH
Post Reply