Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HTTP header to control filename?

0 views
Skip to first unread message

Ray Henry

unread,
Aug 21, 1999, 3:00:00 AM8/21/99
to
Is there a header I can set to give the browser a default filename for a
saved document? My script sets the ContentType but the name the browser
wants to use for the file is download.asp (the name of my ASP script). Can I
set a header with Response.AddHeader to change this?

David Efflandt

unread,
Aug 21, 1999, 3:00:00 AM8/21/99
to

You can specify it for Netscape, but it will not work with MSIE which
ignores MIME headers (including Content-type:). You could use path info,
which is an extented fake path in the URL past the asp ending with the
desired filename. Example <a href="download.asp/some.jpg">download</a>.
The server will run the asp and the browser will think it is accessing the
jpg. At least that is the way it should work, but I have not tried it on
NT.

--
David Efflandt effl...@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com/ http://cgi-help.virtualave.net/

Ray Henry

unread,
Aug 21, 1999, 3:00:00 AM8/21/99
to
The download.asp/some.jpg syntax doesn't work on IIS. I tried it already...

Any other ideas?

David Efflandt <effl...@xnet.com> wrote in message
news:slrn7rublq....@efflandt.xnet.com...

Paul R. Morin

unread,
Aug 23, 1999, 3:00:00 AM8/23/99
to

Response.AddHeader "Content-Disposition", "Attachment;
filename=somefilename.ext"

Should do the trick...

- Paul

Ray Henry <henryrt@aol-dot-com> wrote in message
news:#uvDEXB7#GA.267@cppssbbsa04...

0 new messages