What's new

Correct mime types

Slougi

New member
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.
 

Martin

Active member
Administrator
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

Active member
Administrator
I think I got it right now, let me know if it works or not. :)

Works here at least (in Phoenix).
 
OP
S

Slougi

New member
Cool, thanks :) Mostly I missed being able to view text files in the browser.

/me goes browse board for a while
 

Top