faqts : Computers : Programming : Languages : JavaScript : Document

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

70 of 116 people (60%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How can I SaveAs with a new filename AND specify the file type, i.e., Web Page, HTML Only
beside save as htm and txt in IE , can i save as jpeg or other formats ?

May 15th, 2001 10:21
Thor Larholm, Richard Brennan, henry chan,


You can change the SaveAs Type in the SaveAs dialog box by specifying 
the third argument to execCommand, e.g.:
document.execCommand("SaveAs",false,".txt") // Let the user save 
as .txt file
document.execCommand("SaveAs",false,".htm") // Save as .htm file
document.execCommand("SaveAs",false,"filename.htm") // Save as 
filename.htm