if you never want pdf's to display from this site, you can update the server
mime type mapping for the vdir. a good solution would to create a seperate
vdir under your main vdir (say called download), that you update the mime
mappings, and a another vdir (using the same dir, say called display) that
has the standard mapping. then
mysite/download/mypdf.pdf
will use the save as, while
mysite/display/mypdf.pdf
will load in the browser
-- bruce (sqlwork.com)
"Raterus" <mo*********@suretar.reverse> wrote in message
news:uA**************@TK2MSFTNGP10.phx.gbl...
As long as you are linking directly to the pdf file on your webserver, the
webserver (most likely) is going to send the HTTP headers in a way so your
browser will attempt to open it up. To avoid this, you are going to have to
create your own download page, which sets the headers you need to show the
"save as" box, and then stream the file from your webserver to the client.
Then your href in the hyperlink will look something like this
a.href="http://www.someurl.com/download.aspx?file=registration.pdf"
If you mentioned you were looking at articles about "content-disposition",
you'll have to use this in the download page.
--Michael
"tma" <tm*@allisconfusing.net> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl...
Short of zipping my file, are there any other alternatives to the below?
I'm trying to add anchors in code and I need the link to force a download
of the .pdf rather than open a new window or worse, open the file in the
current client browser window. Is there something I can change about the
anchor itself to force this behavior? I did not have any success with the
"content-disposition" articles suggested.
Here is my very normal anchor code:
a = New HtmlAnchor
a.HRef = "http://www.someURL/Registration.pdf"
a.InnerText = "Print Application"
a.Target = "_blank"