AlexB <ab*******@fresno.ca.gov> wrote:
I want to force a "save as" dialog box to open in IE when
a user downloads a text file. Here's my code:
<a href="test.log">Download File</a>
The problem is IE opens the file and shows it in the
browser. Any help is appreciated.
You need to make sure that when the server serves the file, it has an
appropriate disposition. Unfortunately you need to detect which kind of
browser is being used to do that properly, as some versions of IE don't
handle it appropriately.
For most browsers, use:
Content-Disposition: attachment;filename=test.log
For IE 5.5 use:
Content-Disposition: file;filename=test.log
I don't know about IE6, I'm afraid.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too