<% response.buffer = false ''Response.ContentType = "application/x-unknown" ' arbitrary ''FPath = request("url") ''Response.AddHeader "Content-Disposition","attachment; filename=" & FPath ''Response.End dim FileSplt ContentType = "application/octet-stream" strFilePath = request("url") FileSplt = split(strFilePath, "/") strFileName = FileSplt(ubound(FileSplt)) '' Grab filename from the url strFileName = replace(strFileName," ","_") strFilePath = replace(strFilePath,"http://nl.makitamedia.com","") strFilePath = replace(strFilePath,"https://nl.makitamedia.com","") If not strFilePath = "" Then strFilePathArray = Split(strFilePath,"/") For g = 0 to ubound(strFilePathArray) If g <> ubound(strFilePathArray) Then strFilePathUse = strFilePathUse & "/"&strFilePathArray(g) End If Next strFilePathFileUse = strFilePathArray(ubound(strFilePathArray)) strFilePathUse = replace(strFilePathUse,"//","/") End If Dim stream, i Const BlockSize = 1000 Response.Charset = "UTF-8" Response.ContentType = "application/octet-stream" Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName Set stream = CreateObject("ADODB.Stream") With stream .Type = 1 .Open .LoadFromFile server.mappath(strFilePathUse)&"/"&strFilePathFileUse End With For i = 1 To stream.Size Step BlockSize Response.BinaryWrite stream.Read(BlockSize) Next If stream.Size Mod BlockSize = 0 Then Response.Write stream.Read %>