以文件流方式读取文件的时候怎么才能获得原有文件的文件名和文件类型
以文件流方式读取文件的时候怎么才能获得原有文件的文件名和文件类型
以下过程保存非IE能显示文件时会提示下载,但是文件名和类型却无法保留原来
Function DownFile(Path)
Response.Clear
Set OSM = CreateObject(adodb.stream)
OSM.Open
OSM.Type = 1
OSM.LoadFromFile Path
Response.AddHeader "Content-Disposition", "attachment; filename=" & Path
Response.Charset = "UTF-8"
Response.ContentType = "application/octet-stream"
Response.BinaryWrite OSM.Read
Response.Flush
OSM.Close
Set OSM = Nothing
End Function
问题点数:20、回复次数:1Top
1 楼madpolice(午夜狂龙)回复于 2005-08-26 13:15:37 得分 20
Response.AddHeader "Content-Disposition", "attachment; filename=" & "aaaa.txt"
Top




