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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SaveAs doesn't save the linked file

Status
Not open for further replies.

archit

Programmer
Aug 22, 2002
19
US
Hi All ,
I have a link in my page which points to an XML file in my tomcat web server. I want that when users click on that link they should get a Save As dialogue box which will save the file.
i tried with the SaveAs function on the OnClick button but that tries to Save te Html page in which that link is not the XML file that link points to. Attaching below the code which I am using . Kindly send in your sugestions as to how to achieve the desired functionality.

out.println(&quot;<br><br><center><b> <a href='downloads/&quot;+filename+&quot; onClick=&quot;document.execCommand('SaveAs')'; return false;&quot;>Get the XML File Generated</a></b></center>&quot;);

Thanks in advance
Vikul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top