Not sure if this is on topic, but it's sort of Linux-related, so bear with me.
I like to think I know HTML reasonably well, but I can't make it do what I
want to do. I have a file I want others to be able to click on to download,
something like this:
<a href=
http://mysite.com/myfile.deb>Click to download myfile</a>
It appears that the default settings on a lot of browsers don't recognize the
file extension. (I know that my version of Netscape doesn't.) So the
browser tries to display the binary file as text, and in some instances it
may crash. So I figured there must be a way in in HTML to force the download
dialog, without having to tell the remote user to reconfigure his browser.
Wrong! I searched Google extensively and it appears that HTML is brain-dead
in this respect, though there were many alternate suggestions.
The most frequent reply was "just zip it with zero compression, because
browsers bring up the download dialog on zip files by default." But that
won't do! Every Linux download site worth its salt (e.g., rpmfind,
debian.org) has you click on a link and it works. I've looked at the html
source code and there's nothing unusual in there.
There were other suggestions about using a java servlet, ASP code (does this
work only on MS servers?) and PHP. I also understand that you can have a
"Content Disposition" header in the file to be downloaded - but the files in
question are binary. So what I want to know is, how do these Linux download
sites do it? Is there Java code that doesn't display in the page source? Or
is there some mysterious way to wrap a binary with a "Content Disposition"
header such that the file still works when the user downloads it?
This has been a real puzzler for me, so I'd greatly appreciate any insight
you guys might have.
Vaughn