PDA

View Full Version : Correct mime types



Slougi
May 9th, 2003, 15:45
Currently no mime-type is being sent for attachements. This causes some browsers to download the attachements instead of showing them. Is there an easy fix for this?
This is not a problem for IE because it completely dismisses mime-types, but is clearly broken behavious overall.

Slougi
May 11th, 2003, 22:01
bumpidy bump bump

Martin
May 11th, 2003, 23:47
Yeah, hmm...all vbulletin boards I'm a member of have this problem. I'll go search at vbulletin.org for a possible solution. :)

Edit: Found the answer myself by looking at attachment.php, I just need to add all existing mime types like this:

if ($extension=='gif') {
header('Content-type: image/gif');
} elseif ($extension=='jpg' or $extension=='jpeg') {
header('Content-type: image/jpeg');

And so on...

Slougi: There are mime types set for the most common ones, just not all.

/me compiles list of current mime types and adds it

Martin
May 12th, 2003, 00:31
I think I got it right now, let me know if it works or not. :)

Works here at least (in Phoenix).

Slougi
May 12th, 2003, 06:42
Cool, thanks :) Mostly I missed being able to view text files in the browser.

/me goes browse board for a while