<%@ Language=VBScript codepage=936 %>
<% Option Explicit %>
<%
'传入一个 path 地址, 注意<% %>前后不准有空格与回车
Dim filePath, dataStream, BytesStream
filePath = request.queryString("path")
set BytesStream = server.createobject("ADODB.Stream") With BytesStream
.Open
.Type = 2
.LoadFromFile filePath
dataStream = .Readtext
.Close
End With set BytesStream=nothing Response.AddHeader "content-disposition","attachment; filename="+ Mid(filePath, InStrRev(filePath, "\")+1)
Response.ContentType="application/octet-stream"
Response.BinaryWrite dataStream
%>
<% Option Explicit %>
<%
'传入一个 path 地址, 注意<% %>前后不准有空格与回车
Dim filePath, dataStream, BytesStream
filePath = request.queryString("path")
set BytesStream = server.createobject("ADODB.Stream") With BytesStream
.Open
.Type = 2
.LoadFromFile filePath
dataStream = .Readtext
.Close
End With set BytesStream=nothing Response.AddHeader "content-disposition","attachment; filename="+ Mid(filePath, InStrRev(filePath, "\")+1)
Response.ContentType="application/octet-stream"
Response.BinaryWrite dataStream
%>
解决方案 »
- 超链接实现下载问题
- js保存文件的问题
- confirm不起作用了?在线等 !
- 请问这个怎么用 js 判断?
- 请教关于层被下拉框遮挡的问题,iframe中包含下拉框
- 请帮小弟看看,游侠网www.ali213.net的弹出窗口是怎么做的,ie不能拦截
- 如何读取到数组的长度?
- js里怎么样得到列表框里选定的值
- 设为首页问题
- 一个怪问题,急待解决。
- 高分!如何让一个页面始终获取焦点
- VBScript:Set RegWsh = CreateObject("WScript.Shell")翻译成JavaScript是否是:var RegWsh = new ActiveXObject("WScript.Shell");
<%@ Language=VBScript codepage=936 %>
<% Option Explicit %>
为什么页面不显示?取掉是可以下载的。