Function DL (f, n) on error resume next set s = createObject ("adoDb.stream") s.Mode = 3 s.Type = 1 S.Open S.LoadFromFile (f) if err.number> 0 Then Response. Status = "404" else Response.ContentType = "application / octet-stream" Response.AddHeader "Content-Disposition:", "attachment; filename =" & n Range = Mid (Request.ServerVariables ( "HTTP_RANGE"), 7) if Range = "" Then Response.binaryWrite (S.READ) Else S.Position = ClNG (split ("-") (0)) Response.binaryWrite (S.READ) end if Endiffs
Sample example: Call DL (Server.mAppath ("../ Download / 07.zip"), "07.zip")