Force download of pdf file

D

Don Grover

How do i force a user to download from a hyperlink as adobe pdf file, it
loads up in a new window and I need them to download it, or at least give
them the choice to download it.
Don.
 
D

Don Grover

Thanks Ray
With 40 billion pages on the web i am finding hard remembering where they
all are. :cool:
Don
 
D

DevSonner

<a href="download.asp?FileName=aa.pdf">FileDown</a>


<!-- download.asp //-->
<%
Response.ContentType = "application/unknown"

Response.AddHeader "Content-Disposition","attachment; filename="&
Request("FileName")

Set objStream = Server.CreateObject("ADODB.Stream")

objStream.Open

objStream.Type = 1

objStream.LoadFromFile Server.MapPath("/root/pdf/")&"\"& Request("FileName")

download = objStream.Read

Response.BinaryWrite download


Set objstream = Nothing
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top