Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
September 9, 2005, 9:47 pm
rate this thread
I have an html file where I display name,address,zip. It is one per line so
it is basicall a list of addresses.
But I would like ie6 to force the download prompt of this long list of names
instead of displaying it to their browsers. This way they can save the list
to a file. I know I can set it up as a txt file and let them download it
that way, but right now this file is generated from a source program which I
have no control over and it creates this .html file.
I looked around google and found a few things to try like:
<meta http-equiv="content-disposition","attachment; filename=list.txt">
but these dont seem to work at all.
Thanks for your help.
Re: forcing ie to save the contents of the html instead of displaying it
http-equiv is a joke, it can't be equivalent to most http headers since the
browser has to act on them before starting to handle the body of the http
response. If they are in the body, then its too late.
Use real http headers (how you do that depends on your server and/or server
side programming language), and use content-disposition (rather they lying
about the content type).
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/
Home is where the ~/.bashrc is
- Alan J. Flavell
September 11, 2005, 1:12 am
Re: forcing ie to save the contents of the html instead of displayingit
On Fri, 9 Sep 2005, David Dorward wrote:
As a background remark, though: RFC2616 warns that the use of this
header has serious security implications: in earlier times it was
customary for HTTP user agents to disregard any such header. But as
time went by, the header was implemented in MSIE as well as in web
browsers (sometimes with adequate user protections).
The original idea of the interworking protocols was that it was the
*recipient's* business to decide whether they wanted to render a
resource or to download it. The suthor/publisher's job was just to
advertise its content-type honestly (as you note). The idea of a
mischievous author proposing a download, to some sensitive file on the
recipient's system, and the naive user acceding to the request, is
just too attractive to a certain kind of pondlife on the 'net.
Re: the subject line: generally speaking, "force" does not work, on
the WWW. And it's good that it is so. h t h
- Eric Kenneth Bustad
September 10, 2005, 1:16 am