这个问题不是用客户端脚本来做的, 应该是用服务器端来处理.
<%@ Language=VBScript codepage=936 %>
<% Option Explicit %>
<%
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
%>
<%@ Language=VBScript codepage=936 %>
<% Option Explicit %>
<%
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
%>
解决方案 »
- input button select是块状元素行内元素还是inline-block元素啊?
- 关于一个正则表达式的小问题
- Extjs 4.0,当window和img一起使用时,IE中出错,其他浏览器正常
- 有JS经验的人来下,问题不轻松!我真头都想大了,高宽问题
- html无法加载js文件,以前可以不知道为啥不行了,急!!!!!!!!!!
- 不懂,请教
- MyEclipse里面图片能读 ie也能显示,但是chrome,遨游都不行,怎么回事
- 同样是回到顶部代码在google浏览器中不执行的问题
- 如何在当前窗口背后弹出窗口
- 一个Java问题,关于修改程序。
- 请教一个函数的意思
- 怎么用Javascript实现对树形复选框的控制
谢谢
http://blog.csdn.net/vivianfdlpw/archive/2005/02/28/305170.aspx