<script>
var a=window.open()
a.location="xxx.zip"
</script>
<body>
Test
var a=window.open()
a.location="xxx.zip"
</script>
<body>
Test
解决方案 »
- dom 滚动事件里,怎么判断是水平滚动还是垂直滚动
- showModelessDialog打开的窗口进行数据库操作?
- js如何通过回车键来设置多个输入框间的焦点移动,就是说当按下回车键时,自动跳转到我想设置为焦点的那个输入框
- js页面文字的简反体转换
- 弹出一个层,然后,鼠标可以移动到弹出层上,点上面的链接
- 页面迁移的语法问题,请指教了!
- JS或JQUERY获得表格中同一行不同列的数据
- 判断客户端是否安装 0ffice
- 请教一个关于电子邮件的问题
- 已经定义了一个文本框为readonly/disabled,单击某个按钮后,如何将它设置成可编辑的?
- 如何向数据库中存储图象
- 如何使flash全屏 在flash5中实现
Const ForReading=1
Const TristateTrue=-1 'Unicode
Const FILE_TRANSFER_SIZE=16384 '16k'Use the following line for IIS4/PWS - this is the default for IIS5
Response.Buffer = TrueFunction TransferFile(path, mimeType, filename)
Dim objFileSystem, objFile, objStream
Dim char
Dim sent
send=0
TransferFile = TrueSet objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFileSystem.GetFile(Path)
Set objStream = objFile.OpenAsTextStream(ForReading, TristateTrue)Response.AddHeader "content-type", mimeType
response.AddHeader "Content-Disposition","attachment;filename="&filename
Response.AddHeader "content-length", objFile.SizeDo While Not objStream.AtEndOfStream
char = objStream.Read(1)
Response.BinaryWrite(char)
sent = sent + 1
If (sent MOD FILE_TRANSFER_SIZE) = 0 Then
Response.Flush
If Not Response.IsClientConnected Then
TransferFile = False
Exit Do
End If
End If
LoopResponse.Flush
If Not Response.IsClientConnected Then TransferFile = FalseobjStream.Close
Set objStream = Nothing
Set objFileSystem = Nothing
End FunctionDim path, mimeType, sucess
'Server.MapPath(path)
path = "C:\aa.doc"
mimeType = "application/x-msdownload"
sucess = TransferFile(path, mimeType,"cdd.doc")
Response.End
%>
谢谢,还有别的吗,可指定目录吗c:\aa\