Download.asp? file = file with relative path
You can download this file.
<% Call Downloadfile (Replace (Request ("File"), "" / "," "," / ",")) Function Downloadfile (Strfile) 'Make Sure You Are On The Latest MDAC Version for this to THIS Work '----------------------------------------------- ------------- 'Get Full Path of Specified File StrfileName = Server.mappath (Strfile)' Clear The Buff RESPONSE.BUFFER = True Response.clear 'Create Stream Set S = Server.createObject ( "ADODB.Stream") s.Open 'Set as binary s.Type = 1' load in the file on error resume next 'check the file exists Set fso = Server.CreateObject ( "Scripting.FileSystemObject") if not fso.FileExists ("
") response.end end if 'get length of file set f = fso.getfile (StrfileName) INTFILENGTH = f.size s.loadfromfile (strfilename) if Err the response.write ("
") response.end endiffs the headers to The Users Browser Response .AddHeader "Content-Disposition", "attachment; filename =" & f.name Response.AddHeader "Content-Length", intFilelength Response.CharSet = "UTF-8" Response.ContentType = "application / octet-stream" 'output The file to the browser response.binarywrite s.read response.flush 'tidy up s.close set s = Nothing end function%>