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!

Force IE To Download A File NOT Display In IE

Status
Not open for further replies.

apc2003

Programmer
Aug 29, 2003
54
0
0
GB
I need a piece of javascript that forces IE to pop up the file download dialog instead of opening and displaying the file within the IE window.

Currenly I am using:
Code:
window.open(file, title, windowParams)
to load a .rtf file...

But IE supports this file format and displays it instead of prompting for download.

Can anyone suggest how to make IE always prompt for download of a given file?
 

You could change the MIME type fro RTF files server-side to a generic binary type... That way, it would work for most browsers, not just IE.

Hope this helps,
Dan
 

Now that depends on which web server you are using. Once you know that, ask in the forum for that web server.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top