<% On Error Resume Next dim File, Folder, FilePath File = trim(request("File")) Folder = trim(request("Folder")) FilePath = EditorRootFolderPath & Folder & "\" & File Response.ContentType = "application/x-unknown" ' arbitrary Response.AddHeader "Content-Disposition", "attachment; filename=" & File Response.Buffer = False Server.ScriptTimeout = 30000 ' Option 1 dim adoStream, chunk, iSz, i Set adoStream = CreateObject("ADODB.Stream") with adoStream .Open() .Type = 1 .LoadFromFile(FilePath) Response.BinaryWrite .Read() .Close end with Set adoStream = Nothing if err.number = 0 then response.end if err.number <> 0 then err.clear ' Option 2 Set adoStream = CreateObject("ADODB.Stream") chunk = 2048 adoStream.Open() adoStream.Type = 1 adoStream.LoadFromFile(FilePath) iSz = adoStream.Size Response.AddHeader "Content-Length", iSz For i = 1 To iSz \ chunk If Not Response.IsClientConnected Then Exit For Response.BinaryWrite adoStream.Read(chunk) Next If iSz Mod chunk > 0 Then If Response.IsClientConnected Then Response.BinaryWrite adoStream.Read(iSz Mod chunk) End If End If adoStream.Close Set adoStream = Nothing Response.End %>