国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > ASP > 正文

ASP使用流輸出文件下載

2024-05-04 11:06:49
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
<%
' 下載文件
function downloadfile(fullpath)

downloadfile = false

dim strfilename, s, fso, f, intfilelength

set fso = server.createobject("scripting.filesystemobject")

if not fso.fileexists(fullpath) then


exit function

end if

set f = fso.getfile(fullpath)

'獲取文件大小

intfilelength = f.size

set s = server.createobject("adodb.stream")

s.open

s.type = 1

s.loadfromfile(fullpath)

response.buffer = true

response.clear

'response.addheader "Content-Encoding","GB2312" ' 亂碼的解決方案

'response.addheader "content-type","application/x-msdownload"

response.addheader "content-disposition","attachment;filename=" & f.name

response.addheader "content-length" ,intfilelength

response.contenttype = "application/octet-stream"

while not s.eos


response.binarywrite s.read(1024 * 64)


response.flush

wend

s.close

set s = nothing

downloadfile = true
end function
%>

 
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 濮阳市| 巫溪县| 尚义县| 屯留县| 江阴市| 明溪县| 青龙| 溧阳市| 黄冈市| 天峨县| 东兰县| 孟州市| 伊金霍洛旗| 曲阳县| 西青区| 昌吉市| 隆昌县| 安陆市| 保德县| 勐海县| 闽清县| 云龙县| 财经| 定边县| 边坝县| 石台县| 松桃| 林甸县| 宝丰县| 阆中市| 于都县| 平原县| 开封县| 福鼎市| 运城市| 永顺县| 綦江县| 高邮市| 北京市| 尚志市| 新郑市|