List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:June 23 1999 3:56pm
Subject:Re: MySQL - Command to download a file
View as plain text  
On Mi, 1999-06-23 14:34:28 +0000, Garrick Staples wrote:
>     With every request, the web browser decides whether to handle the
> file itself, with an external program, or to download it.  Basicly,
> everything that the browser doesn't recognize is downloaded.  Just
> change the extension of the file and instruct the person to rename the
> extension.  The convention is to replace the last letter with '_'... 
> .jpg turns into .jp_
>     Also, you can change the MIME type to something the browser won't
> understand if you are talking about CGI output.

The letter is the way as it should be done in first place, and to be
more specific the MIME type for binary data is "application/octet-stream".

Any browser getting data of this MIME type should treat it as binary
data, and this normally means to save it into a file.
I'm not entirely sure, if also Microsoft software does it this right
way (regardless of the - in this context - meaningless extension) ...

Truncating the filename extension doesn't seem to be a very elegant
way, because you loose some information.  If you really have to do
something like that better add a second extension like ".bin".

If you're using Apache as your web server, changing the MIME type of a
single file can be done with this configuration directive (maybe in a
.htaccess file):
  <Files thefile.gif>
  AddType application/octet-stream

Martin Ramsch <m.ramsch@stripped> <URL: >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
MySQL - Command to download a fileSheni R. Meledath23 Jun
  • Re: MySQL - Command to download a fileFred Read23 Jun
  • Re: MySQL - Command to download a fileGarrick Staples23 Jun
    • Re: MySQL - Command to download a fileMartin Ramsch23 Jun