Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

44 of 73 people (60%) answered Yes
Recently 9 of 10 people (90%) answered Yes


Can I use the document.execCommand() method to save a file without popping the "Save As" dialog?

Apr 7th, 2008 22:34
ha mo, Michael Davison, Kenny Mok,

document.execCommand has the following syntax:
  bSuccess = document.execCommand("SaveAs" [, bUserInterface][, sValue])
The second argument, which is optional, specifies whether or not to 
show the dialog when saving the file.  The default is to show the 
dialog, but if you specify 'false' the command will try to save the 
file to the filename given in sValue.  Of course, if sValue is not a 
valid file or path, this will not succeed.