How to force a download

Is there a way to force a download rather than have the browser interpret the file? This would be for an image file, .doc or .txt file. My pages are written in ASP where I use both VBscript and JavaScript.

There’s no way for a browser to force something to execute simply by visiting the particular page, or by opening an Email w/o opening the attachment in it. If there were, it would be impossible to rely on the web for anything. People would simply plant self-running EXE files with the format command (with all irreversible switches included) to create anarchy, or be hilarious, or show off their teen angst, or whatever reason untalented moron hackers think DOS or worm viruses are impressive.

I think I phrased the question poorly. As it is, when I click on a link to say a .DOC file (Word document), the file appears in my browser (IE 5.5). If I click on an .EXE file, a download dialog box appears asking me if I want to download to disk or run from the site. This is because browsers cannot display .EXE files. Is there a way that anyone knows of to always have the option to download or run? For a good demo, try emailing yourself a .DOC file to your Hotmail account and then try to open that file…it will prompt for your decision. Then make a local .HTML file that links to a .DOC and see what happens…I want my browser to behave like it does from Hotmail.

You could always Download Gozilla. Then, whenever you want to download a txt or other file that normally opens in the browser, just give Gozilla the file’s URL and it’ll download it for you.

hijack
Hmm. Dooku. Interesting choice of username…
/hijack

I think this is too obvious an answer, but have you tried right-clicking (ctrl-clicking on a Mac) instead of double-clicking? That should give you a menu that will have an option to save the target file.

Browsers have settings that tell how to handle different file types based on the extension. I don’t use IE, so I don’t know how to change its settings. In Netscape, it’s under Edit -> Preferences -> Navigator -> Applications. For example, you could specify .DOC files to be handled by specific programs, or if there is no entry in this table, you will be prompted to save the file. Also in Netscape, you can specify to always ask before opening a specific file type, which also give the option to save it. IE may use the Windows File Types association.

Also, some programs install plug-ins to allow you to access documents through the browser. A good example is Adobe Acrobat Reader. You can set this up to open PDF files in the browser window, to open Acrobat, or to save the file.

Saltire, the right-click only works on certain file types, mainly image files.