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