Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Nym Pseudo
September 1, 2003, 12:26 am
rate this thread
Interesting. Please Clarify: Are you saying there is a way to
force the browser to download to disk instead of loading into
a window? If so, how compatible is this? Can you give an
example? Here's my code:
<A HREF="Sample.txt">Download this document.</A>
How do I force the browser to download TXT and DOC files
to disk instead of displaying in window? Thanks.
Re: How to download file?
you need to specify the content-disposition header.
Content-Disposition: attachment; filename=somefile.txt
Will cause current browsers to prompt with open/save dialog. I am not
really sure of the history of why this was adopted by browsers. You will
have to set this header manually for this file on the web server, or stream
it via CGI so you can add your own headers.