日期:2014-05-17 浏览次数:20376 次
<% Response.Buffer = true Response.Clear Dim fso,fl,flsize dim Dname Dim objStream,ContentType,flName,isre,url1 Dname= Server.Mappath("111.doc") Set fso=Server.CreateObject("Scripting.FileSystemObject") Set fl=fso.getfile(Dname) flsize=fl.size Set fl=Nothing Set fso=Nothing Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open objStream.Type = 1 objStream.LoadFromFile Dname ContentType = "application/octet-stream" Response.AddHeader "Content-Disposition", "attachment; filename=" & Server.UrlEncode("新名字.doc") 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 %>