📄 download.asp
字号:
<!--#include file="asp/checkuser.asp"-->
<%
'此程序作用:让所下载的程序不是以相关联程序打开,而是下载.如:如果直接给word文档的地址,
'点击时,就会在客户端IE浏览器打开该文档,而不是提供下载
'此程序在是MengXHFileDownLoad组件下工作的.MengXHFileDownLoad为一VB编程组件,现存放
'目录..asp\MengXHFileDownLoad.dll下,运行时,要用户注册.
'但下载的路径要为服务器的绝对地址
Response.buffer = TRUE
Response.ContentType = "APPLICATION/OCTET-STREAM"
filepath=oabusyuserpath
' filepath=oabusyuserurl
path=request("path")
if right(filepath,1)<>"/" then filepath=filepath & "/"
filename=mid(path,instrrev(path,"/",-1)+1,len(path))
path=filepath&path
' path="f:/wwwroot/meetfile/"&path
'path=mid(path,instrrev(path,"/",-1)+1,len(path))
' path="f:\wroot\e1\upfile\meetword\"&filename
'Response.Write path
Response.AddHeader "Content-Disposition","attachment;filename="&filename
Dim varStream, oMyObject
Set oMyObject = Server.CreateObject("MengXHFileDownLoad.BinReadFromFile")
varStream = oMyObject.readBinFromFile(path)
Response.BinaryWrite(varStream)
Set oMyObject = Nothing
Response.End
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -