[thelist] Playing with MIME type (was: Downloading .jpg & .pdf files)
Joe Crawford
jcrawford at avencom.com
Mon May 21 17:24:31 CDT 2001
Jakob Dölling wrote:
> Morn:
>
> Joe Crawford schrieb:
> >
>
> > > With an NCSA-compatible server like Apache, you simply put a files
> > > in a special download-only directory, and stick an .htaccess file in
> > > that directory for each file type:
> > > AddType application/octet-stream jpg
> > > AddType application/octet-stream pdf
> > >
> > > Since the application/octet-stream MIME type is simply a stream of
> > > 8-bit data of unknown use, there aren't going to be any applications
> > > set up to open it. If you want to have fun, you can use
> > > AddType application/evolt-download-only jpg
> > > AddType application/evolt-download-only pdf
> > > or even
> > > AddType be/mine jpg
> > > AddType true/love pdf
> >
> > Is this going to work on IE/Windows? It's my understanding that IE makes
> > guesses about files with strange MIME types based on the extension. Have
> > you used this successfully? It's an interesting and clever shorthand (I
> > like!) - but does it work to bring up the "prompt to save" box for most
> > browsers in a reliable way? And does doing it this way impact Macintosh?
> > It seems like feeding an unknown mime type might make it unviewable (to
> > most users) on the Mac side.
>
> Joe,
> be calm, it will. This is not HTML as you might not noticed, these are
> instructions for *server* how it has to deliver data. If have installed
> Acrobat and you follow link that refers to pdf file, normally the
> browser plugin of Acrobat kicks in and displays the file. This is the
> default scenario. But if you tell your server to deliver as binary data,
> you'll be prompted in your browser where you would to store the files.
> That's the difference.
>
> Hope you're satisfied,
Oh I'm calm, but what you suggested works only if browsers work as they
should.
Nope. Just tested it here:
http://artlung.com/temp/mime/
added an .htaccess file with:
AddType application/octet-stream gif
And a file:
http://artlung.com/temp/mime/blogger-example.gif
And in IE5/WinNT it just shows the gif. No prompting.
Netscape 4, when viewing the URL, does a prompt box.
And I'm quite satisfied, I learned something new. That your solution,
while correct to the spec, is not how actual browsers work.
- Joe <http://artlung.com/>
--
Joe Crawford |||||||||||||| mailto:jcrawford at avencom.com
|||||||||||||||||||||||| http://www.avencom.com
||||||||||||||||||||||||||| Avencom: Set Your Sites Higher
More information about the thelist
mailing list