Click here to get back home

forcing ie to save the contents of the html instead of displaying it

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
forcing ie to save the contents of the html instead of displaying it Julie 09-09-2005
Posted by Julie on September 9, 2005, 5:47 pm
Please log in for more thread options


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-type","application/download">

<meta http-equiv="content-type","application/force-download">

<meta http-equiv="content-type","application/octet-stream">

<meta http-equiv="content-disposition","attachment; filename=list.txt">

but these dont seem to work at all.

Thanks for your help.




Posted by David Dorward on September 9, 2005, 7:26 pm
Please log in for more thread options


Julie wrote:

> <meta http-equiv="content-type","application/download">
> <meta http-equiv="content-type","application/force-download">
> <meta http-equiv="content-type","application/octet-stream">
> <meta http-equiv="content-disposition","attachment; filename=list.txt">

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

Posted by Alan J. Flavell on September 10, 2005, 9:12 pm
Please log in for more thread options


On Fri, 9 Sep 2005, David Dorward wrote:

> Use real http headers (how you do that depends on your server and/or
> server side programming language),

Indeed...

> and use content-disposition (rather they lying about the content
> type).

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).

http://www.w3.org/Protocols/rfc2616/rfc2616-sec15.html#sec15.5

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


Posted by Eric Kenneth Bustad on September 9, 2005, 9:16 pm
Please log in for more thread options


>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-type","application/download">
>
><meta http-equiv="content-type","application/force-download">
>
><meta http-equiv="content-type","application/octet-stream">
>
><meta http-equiv="content-disposition","attachment; filename=list.txt">
>
>but these dont seem to work at all.
>
>Thanks for your help.

Why *force* them to download it? Certainly they can get their browser
to do this if *they* want it to without any special work on your part?
Or does ie6 not have this capability?

--
= Eric Bustad, Norwegian bachelor programmer

Similar ThreadsPosted
Fixing a Table of Contents Menu, when contents Scroll May 5, 2008, 7:40 am
forcing two hr on the same line January 5, 2007, 10:22 am
Why can't I save this page as a file and where's the source html? June 22, 2005, 2:08 am
changing file name in "Save as" option for html files October 26, 2005, 3:43 am
Forcing adjacent elements to have the same height May 17, 2005, 11:28 pm
Small Screen Rendering : Forcing It March 10, 2007, 10:20 pm
html link to excel spreadsheet without open/save prompt April 20, 2005, 1:17 pm
Forcing retrieval of a fresh copy of a file with a link May 30, 2008, 8:47 am
better/easy way to displaying c source code in html July 18, 2006, 5:44 am
Can't locate problem in HTML code IE ignores but Firefox is displaying. November 29, 2004, 2:01 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap