Jump to content

download script for web button


banjoman

Recommended Posts

I have created a button that will enable the reader of my webpage to download a zip file from my site<button onClick="java script:window.open('relative link to file');">download</button>using IE and Firefox this will open an open/save option windowbut it also, of course, opens a blank webpage, which is a bit inconvenient!is there a script that will enable a file download without opening a blank webpage window?which is the best, most efficient way of enabling a user to download a file? what are the alternatives?

Link to comment
Share on other sites

try

<input type="button" value="download" onclick="window.location='relative path to file'"/>

Does this work???You could also have a hidden iframe on the page and when the button is click have the src of the iframe chaneg tot he file for download....this gets rid of the need for popup windows and should start the download without changeing to another page.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...