By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,384 Members | 1,847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,384 IT Pros & Developers. It's quick & easy.

How to open "SaveAs" dialog box in Firefox browser?

P: 1
Hi,

Am unable to open javascript SaveAs dialog box in Firefox browser. Following is the script,

<a href="javascript:void(0);" onclick="document.execCommand('SaveAs',false,'*.xy z');">Save this page</a>

The above script works fine in IE. Can anyone please let me know how do I make the SaveAs dialog box open in Firefox browser.

Thanks,
Sanjay
Sep 18 '06 #1
Share this Question
Share on Google+
2 Replies


acoder
Expert Mod 15k+
P: 16,027
execCommand("saveas") is not supported in Firefox.
May 13 '08 #2

Expert 100+
P: 392
It is generally a bad idea to try and include direct local access as part of your web app program design. There are a lot of restrictions on doing local access, and for good reason. The execCommand() function only works in IE, and only if the user's security settings are low enough.

If you have access to the server side logic you can send a request for the file to the server, and then have the server set the HTTP Response MIME type to a made up value like "application/unknown" that will get the browser to open a dialog box to save the file.
May 15 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.