右键点击IE链接的“目标另存为”如何用程序实现?急。。。 是啊 是啊 csdn就有 自己查看一下源代码吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.execCommand ('saveAs')实现的是把本页面另存为,我想要的是目标文件另存为。比如:<a href="test.doc">test</a>如何用脚本实现把test.doc另存为 document.execCommand ('saveAs')</Content>或javascript:saveas(xxxxxx) test.doc压缩成test.rar,然后<a href="test.rar">test</a> 把文件另存,如果是浏览器不识别的文件,就直接出来了如果是浏览器识别的话,Doc之类的,就需要用流模式写出引用AdoAdoStream.OpenAdoStream.Type = 1AdoStream.LoadFromFile FileNameSelect Case LCase(Right(FileName, 4)) Case ".asf" ContentType = "video/x-ms-asf" Case ".avi" ContentType = "video/avi" Case ".doc" ContentType = "application/msword" Case ".zip" ContentType = "application/zip" Case ".xls" ContentType = "application/vnd.ms-excel" Case ".gif" ContentType = "image/gif" Case ".jpg", "jpeg" ContentType = "image/jpeg" Case ".wav" ContentType = "audio/wav" Case ".mp3" ContentType = "audio/mpeg3" Case ".mpg", "mpeg" ContentType = "video/mpeg" Case ".rtf" ContentType = "application/rtf" Case ".htm", "html" ContentType = "text/html" Case ".txt" ContentType = "text/plain" Case Else ContentType = "application/octet-stream"End SelectResponse.AddHeader "Content-Disposition", "attachment; filename=" & FileManager.GetFileName(FileName)Response.AddHeader "Content-Length", FileSizeResponse.Charset = "UTF-8"Response.ContentType = ContentTypeResponse.BinaryWrite AdoStream.ReadResponse.FlushResponse.ClearAdoStream.CloseSet AdoStream = Nothing将文件指向某一页面,然后再该页面写入上面代码,传入正确的文件路径和名称,就可以了 注意,Ado最好是版本高一点的~~ 表单提交设置快捷键 ,“ctrl”+'enter' 一个下拉框的JS问题,请哪位高手帮帮忙 问一个javascript的mouseover问题? 急~~~ firfox下如何判断是否为对象? javascript里,“$”符号是什么意思? 项目开发困难! 正则 清除 onXXX 事件 求解一个网页限制问题 紧急求助——关于下拉菜单的问题 十万火急!在线等!怎样解决同一页面内变量传递 难受死了....框架问题 窗口之间的交互
比如:
<a href="test.doc">test</a>
如何用脚本实现把test.doc另存为
或
javascript:saveas(xxxxxx)
<a href="test.rar">test</a>
AdoStream.Open
AdoStream.Type = 1
AdoStream.LoadFromFile FileName
Select Case LCase(Right(FileName, 4))
Case ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "application/msword"
Case ".zip"
ContentType = "application/zip"
Case ".xls"
ContentType = "application/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html"
ContentType = "text/html"
Case ".txt"
ContentType = "text/plain"
Case Else
ContentType = "application/octet-stream"
End Select
Response.AddHeader "Content-Disposition", "attachment; filename=" & FileManager.GetFileName(FileName)
Response.AddHeader "Content-Length", FileSizeResponse.Charset = "UTF-8"
Response.ContentType = ContentTypeResponse.BinaryWrite AdoStream.Read
Response.Flush
Response.Clear
AdoStream.Close
Set AdoStream = Nothing将文件指向某一页面,然后再该页面写入上面代码,传入正确的文件路径和名称,就可以了