这个好象比较麻烦,
不过如果做个asp程序可能要好办写另外你研究研究xmlhttp
不过如果做个asp程序可能要好办写另外你研究研究xmlhttp
解决方案 »
- 用javascript怎样实现DW属性面板中的链接作用
- 使用Gson解析json报错了,哪位英雄看下。。
- Flash+JS云标签免费下载
- javascript修改URL #号后面的参数不回发
- 很诡异的双引号问题,2行代码而已
- 怎么在状态栏里显示信息?
- 请问如何使页面不接受 退后键 操作 ???????????
- HELP!!!! 100分!html中Javascript利用Xmlhttp传递给asp中文字符乱码!
- 用JAVA怎么做出so.htm?no=1和so.htm?no=2显示不同的文字内容?
- jsp向servlet传值,返回刷新后的页面问题
- 在一个td里面放一个<input type = "text">,如何让他占据整个单元格?
- 下拉框实现下拉一个IFrame(见代码),但不知道怎么会这样…………????
Response.Buffer = True ' clear the buffer
Response.Clear
s="aa.txt"
download ssub download(f)
set objdownload = server.createobject("adodb.stream")
objdownload.Open
objdownload.Type = 1
f=server.mappath(f)
objdownload.LoadFromFile f
Response.BinaryWrite objdownload.Read
end sub
%>
如果是未知的 ,就可以直接下载了.有ASP可以实现..
直接让客户端浏览器下载已知类型的文件
http://www.csdn.net/Develop/Read_Article.asp?Id=13004
' =========================================
'
' 利用ADODB.Stream使用浏览器下载服务器文件
' download.asp?file=相对路径的文件
'
' =========================================
file="imgbutton1.gif"
call downloadFile(replace(replace(file,"\",""),"/","")) Function downloadFile(strFile)
' make sure you are on the latest MDAC version for this to work
' ------------------------------------------------------------- ' get full path of specified file
strFilename = server.MapPath(strFile) Response.Buffer = True ' clear the buffer
Response.Clear
Set s = Server.CreateObject("ADODB.Stream") ' create stream
s.Open
s.Type = 1 ' Set as binary
''on error resume next ' load in the file
' check the file exists
'Set fso = Server.CreateObject("Scripting.FileSystemObject")
'if not fso.FileExists(strFilename) then
' Response.Write("<h1>Error:</h1>" & strFilename & " does not exist<p>")
' Response.End
'end if ' get length of file
'Set f = fso.GetFile(strFilename)
'intFilelength = f.size s.LoadFromFile(strFilename)
'if err then
' Response.Write("<h1>Error: </h1>" & err.Description & "<p>")
' Response.End
'end if ' send the headers to the users browser
'Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
'Response.AddHeader "Content-Length", intFilelength
''Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream" ' output the file to the browser
Response.BinaryWrite s.Read
Response.Flush
' tidy up
s.Close
Set s = Nothing
End Function
%>
有没有类似saveas之类的函数可以用啊,实际上点目标另存为就可以下载,但是我想做一个下载按纽来实现,主要是单位上很多人计算机极不熟悉,要做一个直观的
就可以直接下载啦.