Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem With Download PDF

Status
Not open for further replies.

melginger

Programmer
Jul 27, 2001
54
CA
three things:

1) I want to download multiples PDF at once from my Extranet site

2) I want to send to the Client printer, multiple PDF

3) But first of all,I can't make that code work for me. It supposed to force the dialog box for Saving but it displays the content of my file.

Dim file
Dim path

file="1002564.pdf"
path=Server.MapPath("\TestPDF\" & file)

set fso=Server.CreateObject("Scripting.FileSystemObject")
set f=fso_OpenTextFile(path)
data=f.ReadAll
ext=fso.GetExtensionName(path)
if ext="pdf" then Response.ContentType="application/pdf"
if ext="doc" then Response.ContentType="application/msword"

Response.AddHeader "Content-Disposition"," attachment; filename=test.pdf"
Response.BinaryWrite data
Response.Flush

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top