国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 武宣县| 克什克腾旗| 都安| 隆子县| 利辛县| 顺平县| 彭泽县| 新昌县| 绥芬河市| 新乡市| 江城| 高雄市| 太康县| 达日县| 耿马| 额济纳旗| 木里| 邹平县| 莱西市| 大悟县| 永安市| 手游| 鹤岗市| 贵阳市| 绍兴市| 荥阳市| 崇信县| 溧水县| 松江区| 蛟河市| 龙海市| 泸定县| 城固县| 永川市| 普兰店市| 凌海市| 泸州市| 万源市| 奉化市| 武冈市| 兴海县|