View Full Version : execCommand(SaveAs)

04-04-2005, 03:15 PM
I have a document which I want my end users to be able to save to their machines without having to 'Right Click' a link and choose 'Save Target As'.

I have been working with a function that uses the 'execCommand(SaveAs)' command.

The problem is, this only allows the user to save the file as an 'html' or 'txt' file.

Is there any way to use this function (or any other) to trigger on onclick event which will save the selected file in it's original format to their machine?

***I am working within an Intranet and am aware that the execCommand does not work with Netscape***

Any help would be hugely appreciated.

04-05-2005, 06:56 AM
Well, the old right click isn't so bad. Generally the user agent has its own configuration as to how to deal with files. A link to a .zip, .exe or .pdf file will usually trigger an automatic user agent query:

Save or Open?

But not always. Usually people who have changed this behavior know how to download such files if they want to. What type of file do you want folks to DL? I'll bet it is one that most of your users have linked to an application. Anyways, unless all your users are on high speed connections, it would be a courtesy to provide the file as a .zip, unless you think they can't deal with unzipping it.