This would be the basics of it, making the assumption that you're using the Snitz variables. You'll need to create a database connection in this file (you can't include inc_header.asp or any other files that use response.write but you will need to include inc_func_common.asp for the chkstring function) and you'd need to drop the filename of each PDF into a table in that database (FILES, below).dim objStream,intPdf,strPdf
if MemberId>0 then
intPdf=request.querystring("pdf")
if len(intPdf)>0 and isnumeric(intPdf) then
intPdf=clng(intPdf)
set objRs=objConn.execute("SELECT FILENAME FROM FILES WHERE FILE_ID="&intPdf)
if not objRs.eof then
strPdf=chkstring(objRs("FILENAME"),"urlpath")
server.scripttimeout=300
set objStream=server.createObject("ADODB.Stream")
objStream.open
objStream.type=1
objStream.loadfromfile server.mappath("/pdfs/"&strPdf)
response.addheader "content-disposition","attachment;filename="&strPdf
response.charset="UTF-8"
response.contenttype="application/x-pdf"
response.binarywrite objStream.read
objStream.close:set objStream=nothing
end if
objRs.close:set objRs=nothing
end if
end if
<