Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

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

Question posted by: psanjay (Newbie) on September 18th, 2006 03:33 PM
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,'*.xyz');">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
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
acoder's Avatar
acoder
Site Moderator
10,173 Posts
May 13th, 2008
09:25 AM
#2

Re: How to open "SaveAs" dialog box in Firefox browser?
execCommand("saveas") is not supported in Firefox.

Reply
pronerd's Avatar
pronerd
Expert
300 Posts
May 15th, 2008
04:12 PM
#3

Re: How to open "SaveAs" dialog box in Firefox browser?
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.

Reply
Reply
Not the answer you were looking for? Post your question . . .
174,849 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top Javascript / DHTML / Ajax Forum Contributors