ASP執行文件下載

    if filename<>"" then
      fileurl
=server.MapPath("../upfiles/down/"& "\" & filename
    response.clear   
    response.contenttype
="application/octet-stream"
    response.AddHeader 
"content-disposition","attachment;filename=" + filename   
    
set stream=server.CreateObject("ADODB.Stream")
    stream.type
=1  
    stream.open   
    stream.LoadFromFile fileurl 
    
While not stream.eos   
     response.BinaryWrite stream.Read(
1024 * 64)   
    wend   
    stream.Close()   
    
set stream=nothing   
    response.flush   
    response.end()   
    
end if
posted @ 2008-03-19 13:44  Athrun  阅读(163)  评论(0编辑  收藏  举报