Force downloading of a file - do not open!

Associate
Joined
24 Mar 2003
Posts
41
I want to place a button in an html form to download an XML file; however internet exploerer keeps trying to open it in IE instead of saving to disk. Any idea how to force it to save?

Cheers!

<form>
<input type="button" onclick="window.open('http://www.mysite.co.uk/results.xml')" value="download" name="downloadResults">
 
Permabanned
Joined
13 Jan 2005
Posts
10,708
Brain101 said:
I want to place a button in an html form to download an XML file; however internet exploerer keeps trying to open it in IE instead of saving to disk. Any idea how to force it to save?

Cheers!

<form>
<input type="button" onclick="window.open('http://www.mysite.co.uk/results.xml')" value="download" name="downloadResults">

Isnt that a result of having xml files associated with IE?

Try going to an explorer window, going Tools, Folder options, File types, and deleting the xml entry.
 
Associate
Joined
30 Sep 2003
Posts
1,234
Location
Manchester
alternatively, make sure the instructions clearly say...

Right click on the link, and select "Save As..."

people will probably mess it up first time, but they'll go back to their page and realise their mistake.
 
Soldato
Joined
12 Apr 2004
Posts
11,788
Location
Somewhere
Visage said:
Isnt that a result of having xml files associated with IE?

Try going to an explorer window, going Tools, Folder options, File types, and deleting the xml entry.
He's after a solution that will work for everyone, regardless of file associations I think. Try what Dj_Jestar said, that should work :)
 
Back
Top Bottom