"jenny mabe" <ne**@rabidduck.com> wrote in message
news:opr3ym3qx8qafk40@localhost...
| > The help is not very informative here, but it says, that it
is possible
| > to download files, by using the 'a' tag. What I am trying to
do, is
| > create a
| > link, that the user clicks, which will download a file from
the server.
| > This works fine for most files, but for things like TXT and
HTM, they
| > open in the browser window. I want the 'Save As' dialog box
to appear,
| > instead...
|
| the behaviour of the browser is triggered by the file's
| content-disposition header. if you are, for example, streaming
a txt file
| to the user and want to force a download, you can even specify
the file to
| save it as by placing this line above all of the other code on
the page:
|
| Response.AddHeader "content-disposition","attachment;
filename=fname.ext"
|
| more information on this technique and how to use it statically
can be
| found here:
|
|
http://support.microsoft.com/default...p://support.mi
crosoft.com:80/support/kb/articles/Q260/5/19.ASP&NoWebContent=1
|
|
| jenny
Jenny
When you do this dynamically, you would change fname.ext to the
file you wanted download, correct? And you'd place it as below:
<%@ Language=VBScript %>
<% Response.AddHeader "content-disposition","attachment;
filename=sample.htm"
%>
<!DOCTYPE ...>
<html>
<head>
</head>
<body>content of htm file to be downloaded
</body>
</html>
A few quick questions,
1) Could you include asp in the "sample.htm" file (above) that
would be parsed prior to being sent?
2) On the page you referenced, it says, "To apply the header
statically, right-click the document in the Internet Service
Manager...enter the content-disposition header there."
I'm learning, what's the Internet Service Manager. I "presume"
its on the server (IIS)?? I use PWS on Win98SE and haven't ran
across this. I liked the part about the bug in IE4! (ha)
3) On the page you referenced, it also says, "When Internet
Explorer receives the header..." Will this work with other
browsers? i.e., Mozilla, Netscape, Opera...etc.
Thanks for the info in your first reply.
--
Chet
ng******@NOcharterSPAM.net (remove NO.....SPAM)