Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript Save-As: Is there a way

Status
Not open for further replies.

southin

Programmer
Jun 6, 2001
1
US
Hello,

Another project with interesting requirements. Is there a way to call the Web Browser's Save or Save-As function via JavaScript? What I would like to do is place a button name 'SaveAs' on my webpage. I can place a button for print, back, and forward. However no save or save-as.

Thanks
 
You can save a file like this:

Code:
<script language=&quot;javascript&quot;>
<!-- Hide script from old browsers

function save()
{
document.execCommand(&quot;SaveAs&quot;)
}

// End hiding script -->
</script>

Note that this will only work in IE.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top