Click to See Complete Forum and Search --> : Permitting downloadable files, regardless of file type


olerag
07-02-2003, 01:59 PM
I'm trying to access the browser's "File Download" dialog (that, ultimately, provides access to the client's "Save As" dialog, via the "Save" option) regardless of the file type. Is there a way to do this in either html or javascript?

I've placed the "ftp" (in lieu of "http") in the <a href> URL but apparently this will only work if the site is an anonymous FTP server.

If the "http" is provided in the <a href>, only binary executables will display the download diaglog for IE. Consequently, Netscape will provide the download dialog for other file types as well, such as Word documents. Also, Netscape can be "tricked" with a bogus "mime" but won't work with IE.

Regardless, since the browser is permitting a download capability (including image copies), it would seem there would be a way to comminicate with the browser to overide the attempt to "open" the file to access the "download" dialog.

Jona
07-02-2003, 02:50 PM
Originally posted by olerag
Is there a way to do this in either html or javascript?

No, the only way to do this is to send HTTP request headers to the browser, which invokes the download dialogue. (This means, basically, you will need some sort of server-side code to do this.)

[J]ona

olerag
07-02-2003, 04:11 PM
Thanx Jona

That's what we thought was needed. I suspect we'll make a copy of the intended file as a "zip" and call the later with the "a href" statement.

Jona
07-02-2003, 04:22 PM
You could do it this way, but it's less secure, as people could hot-link to your file from another server and thus steal bandwidth. Of course, you could disable hotlinking... :rolleyes:

[J]ona