日期:2014-05-17 浏览次数:20800 次
Sub DownLoadFile(filename,contenttype) Dim fileContentType, stream, filePath filePath=server.mappath(filename) Set stream = Server.CreateObject("adodb.stream") stream.Open stream.Type = 1 stream.LoadFromFile filePath Response.AddHeader "Content-Disposition", "attachment; filename=""" & fileName&"""" Response.AddHeader "Content-Length", stream.Size Response.ContentType = contenttype Response.BinaryWrite stream.read Response.Flush stream.Close Set stream = Nothing response.End End Sub DownLoadFile "excel\13.xls","application/OCTET-STREAM"
------解决方案--------------------