url=server.MapPath("/") & "\softsave\" & fname
set objFso=server.CreateObject("scripting.filesystemobject")
   set fn=objFso.GetFile(url)
   flsize=fn.size
   flname=fn.name
   set fn=nothing
   set objFso=nothing
 
   set objStream=server.CreateObject("adodb.stream")
   objStream.Open
   objStream.Type=1
   objStream.LoadFromFile url
    
   Response.AddHeader "Content-Disposition", "attachment; filename="&fname
   Response.AddHeader "Content-Length",flsize
 
   Response.CharSet="UTF-8"
   Response.ContentType=ContentType
   Response.BinaryWrite objStream.Read
   Response.Flush
   Response.Clear()
   objStream.Close
  set objStream=nothing
posted on 2006-03-08 10:13  竹子  阅读(618)  评论(0编辑  收藏  举报