利用Stream下载文件
2008-09-19 14:54
281 查看
Function dl(f,n)
On error resume Next
Set s=CreateObject("Adodb.Stream")
s.Mode=3
s.Type=1
s.Open
s.Loadformfile(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(Range,"-")(0))
Response.BinaryWrite(s.Read)
End If
End if
Response.End
函数调用实例
call dl(Server.MapPath("text.zip"),"test.zip")
On error resume Next
Set s=CreateObject("Adodb.Stream")
s.Mode=3
s.Type=1
s.Open
s.Loadformfile(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(Range,"-")(0))
Response.BinaryWrite(s.Read)
End If
End if
Response.End
函数调用实例
call dl(Server.MapPath("text.zip"),"test.zip")
相关文章推荐
- 利用xmlhttp和adodb.stream加缓存技术下载远程Web文件
- 利用adodb.stream直接下载任何后缀的文件(防盗链)
- 利用Adodb.Stream直接下载文件
- Asp利用Stream下载文件
- 利用Stream下载文件
- 利用adodb.stream直接下载任何后缀的文件(防盗链)
- 利用Adodb.Stream直接下载文件
- 利用stream直接下载文件
- Asp利用Stream实现文件下载
- 利用ADODB.Stream使用浏览器下载服务器文件
- 利用Adodb.Stream直接下载文件
- 利用requests模块从web下载文件
- 利用JAVA下载网络文件
- 利用ASP下载远程文件到服务器
- iOS利用AFNetworking3.0――实现文件断点下载
- 利用FTPClient类实现文件的上传下载功能
- 利用SecureCRT上传、下载文件(使用sz与rz命令),超实用!
- 利用Socket 实现 FTP 文件上传和文件下载
- C#利用WebClient 两种方式下载文件