ASP使用流输出文件下载
2006-10-30 14:18
666 查看
' 下载文件 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
相关文章推荐
- ASP.Net文件下载-使用流输出
- ASP使用流输出文件下载
- ASP使用流输出文件下载
- Asp.net生成Excel文件并下载(更新:解决使用迅雷下载页面而不是文件的问题)
- 【原】Asp.net生成Excel文件并下载(更新:解决使用迅雷下载页面而不是文件的问题)
- ASP.Net文件下载-使用流输出【转】
- Asp.net生成l文件并下载-----解决使用迅雷下载页面而不是文件的问题
- 解决Asp.net 实现文件下载时、输出文件时文件名的中文乱码和空格异常
- asp.net response输出下载文件的问题
- asp中使用流方式下载文件的代码
- ASP.NET上传下载文件示例,使用webClient实现
- 无可救药的拖延症——关于asp网页使用Access及大图浏览效果以及爬虫登录及下载文件
- ASP.NET上传下载文件示例,使用webClient实现
- [转]在Asp.net MVC中使用Rdlc输出文件
- 解决Asp.net 实现文件下载时、输出文件时文件名的中文乱码和空格异常
- 【原】Asp.net生成Excel文件并下载(更新:解决使用迅雷下载页面而不是文件的问题)
- 使用asp下的adodb.stream 下载文件而不是打开
- 【转】Asp.net下载文件、文件流输出 直接输出文件
- Asp.net生成Excel文件并下载(解决使用迅雷下载页面而不是文件的问题)
- asp.net 下载文件时输出文件内容