zoukankan      html  css  js  c++  java
  • ASP使用流输出文件下载

    function downloadfile(fullpath)
    downloadfile = false
    dim strfilename, s, fso, f, intfilelength 
    set fso = server.createobject("scripting.filesystemobject") 
    if not fso.fileexists(fullpath) then  
    exit function  
    end if     
    set f = fso.getfile(fullpath) 
           '获取文件大小   
           intfilelength = f.size   
           set s = server.createobject("adodb.stream")  
           s.open     
           s.type = 1    
           s.loadfromfile(fullpath)    
           response.buffer = true     
           response.clear     
           'response.addheader "content-type","application/x-msdownload"  
           response.addheader "content-disposition","attachment;filename=" & f.name    
           response.addheader "content-length" ,intfilelength     
           response.contenttype = "application/octet-stream"    
           while not s.eos       
           response.binarywrite s.read(1024 * 64)    
           response.flush    
           wend     
           s.close  
           set s = nothing   
           downloadfile = true  
    end function
  • 相关阅读:
    MySql.Data.dll的版本
    发现一个“佛系记账本”
    坚果云无法同步SVN文件夹
    Kali Linux打开多个终端窗口
    修改Kali Linux终端主题
    Kali Linux搜索软件包
    指定无线网卡监听信道
    解决Aireplay-ng信道问题
    查看干扰进程
    使用Kali官网提供的虚拟机系统
  • 原文地址:https://www.cnblogs.com/QDuck/p/563073.html
Copyright © 2011-2022 走看看