日期:2014-05-16 浏览次数:20894 次
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"