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

Filedownload question

Status
Not open for further replies.

GoTerps88

Programmer
Apr 30, 2007
174
US
I have a link pointing to an xml file. Instead of prompting the user to download the file, it just opens the file. How can I ensure that the user is prompted to download the file?

Thanks.
 
You can't. Especially not with HTML. If the browser believes it knows how to handle certain file type, it will attempt to open it in the browser. What you could do, is deliver this xml file with a different mime type. That way you can fool the browser into thinking it something that it doesn't know and so it forces the download. But that would definitely fall out of scope of this forum -- you would need to ask in the respective fora for your server or server-side scripting.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Mabye you can Zip the file so it has to be downloaded. it will make the file smaller and therefore it will move faster too. (This will only work if you have access to that server and can make the file a Zip file.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top