Response.buffer = TRUE
Set S = Server.createObject ("AdoDb.Stream")
S.Open
S.TYPE = 1
SET FSO = Server.createObject ("scripting.filesystemObject")
if fso.fileexists (strfilename) THEN
Set f = fso.getfile (strfilename)
IntfileLength = f.size
S.LoadFromFile (StrfileName)
Response.addheader "Content-Disposition", "Attachment; filename =" & f.name
Response.addheader "Content-Length", Intfilelength
Response.contentType = "Application / OcTet-stream"
Response.Charset = "UTF-8"
Response.binaryWrite S.Read
Response.flush
S.close (strfilename)
S.Close
SET S = Nothing
Downloading this code will pop up a web page, and cannot be automatically closed, the solution is to set up a frame, let the height of this frame is 0, then that the webpage does not show up.