[thelist] MIME type in href?

Michael Pemberton evolt at mpember.net.au
Fri Jun 11 11:39:59 CDT 2004


Joel D Canfield wrote:
> Is there a way to force a MIME type in a link? That is, to create a link
> to
> 
>     \\server\path\123.1
> 
> and have it open with the correct application?
> 
> joel

There are a few tricks that you can use.  One is to generate the file 
from a script and then output the required headers to tell the browser 
show filetype it is.

Some browsers (read: IE) don't follow the header when it comes to 
detecting the filetype/association.  The best trick to get around this 
is the generate a url the fools the browser into thinking it is 
downloading the file with the original filename.

eg. http://somehost/someprogram/script.php/filename.ext

This should work in most cases.  Maybe someone else on the list can 
explain this better. :D

HTH

-- 
Michael Pemberton
evolt at mpember.net.au




More information about the thelist mailing list