Auto-Download tags/function?

George Phillips (phillips@cs.ubc.ca)
18 May 94 11:47 -0700


John Lewis writes:
>I'm interested in some sort of tag or code which alerts the browser that a
>particular file is for downloading to the local machine only, such as .zip
>or .hqx files, so when the link is clicked, it automatically activates the
>"load to disk" or similar function and prompts for destination on the local
>drive(s).

Yes, this feature have been available for some time. It existed in
Mosaic 1.x for X in hack form: URLs ending in ".saveme" or ".dump"
automatically activated its "save file" dialog box. It is in there
(and in lynx and probably others) in a more reasonable form. The
MIME type "application/octet-stream" causes a save-file dialog.

I use it quite a bit; see http://www.cs.ubc.ca/ftp for one example.

So it all boils down to convincing your server to send the right
MIME type. You can add a new suffix, say ".dump" for application/octet-stream
and do things like:

ln -s file.gif file.dump

However, that raises a small issue in what the browser gives as a default
name for the file. You'd rather have "file.gif" than "file.dump".
One possibility I explored that if "_download_" appears in the local
file name, it triggers the app../oct.. MIME type. So you can do stuff
like:

mkdir _download_; cd _download_
ln -s ../*.gif .

In the best of all worlds, the browsers would understand

Content-Type: application/octet-stream; name="foo.gif"

and life would be easier.