Hi,
I have to create a download link in java script.when i click on that link,it should give open, save,cancel buttons so that i can save one zip file in the path specified for the link.
Please help me in this regard.
Hi,
I have to create a download link in java script.when i click on that link,it should give open, save,cancel buttons so that i can save one zip file in the path specified for the link.
Please help me in this regard.
Just create or modify the link using document.write(), innerHTML, and/or the DOM. Make sure the href for the link is your intended .zip file, and that the onclick event (if any - none is required - will return true). The user's browser will control what happens, but 99.99% will pop an open/save dialogue for anything with a .zip extension.
The best method to use is generally the DOM, but that would depend upon the rest of the code, and your level of knowledge of javascript.
Also, depending upon how secure and accessible this must be, a method other than javascript might be better - something on the server side.
Unless the file to be downloaded needs to be able to change, no javascript is required:
will do fine.HTML Code:<a href="whatever_path/whatever.zip">Whatever</a>
Last edited by jscheuer1; 04-30-2008 at 02:14 PM. Reason: add info
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Thanks so much John.
I am doing from Xml Dom itself.I just gave the path of my zip file to the link.it is working
Bookmarks