Asp实现隐藏文件下载地址方法
来源:互联网 发布:工作计划表软件下载 编辑:程序博客网 时间:2024/04/30 03:21
<IFRAME name=google_ads_frame marginWidth=0 marginHeight=0 src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4490194096475053&dt=1228207634156&lmt=1226285622&prev_slotnames=1891601125&output=html&slotname=3685991503&correlator=1228207634109&url=http%3A%2F%2Fwww.corange.cn%2Farchives%2F2008%2F09%2F1724.html&ea=0&ref=http%3A%2F%2Fwww.corange.cn%2Fhtml%2Fcorange__92.html&frm=0&ga_vid=2091876339.1227189135&ga_sid=1228207634&ga_hid=806981005&ga_fc=true&flash=9.0.124.0&u_h=768&u_w=1024&u_ah=715&u_aw=1024&u_cd=32&u_tz=480&u_java=true&dtd=31" frameBorder=0 width=300 scrolling=no height=250 allowTransparency></IFRAME>
<!--#include file="conn.asp" --> <%
Response.Buffer = true
Response.Clear
dim url
Dim fso,fl,flsize
dim Dname
Dim objStream,ContentType,flName,isre,url1
'*********************************************调用时传入的下载文件名
m_ID=trim(request.QueryString("ID"))
set rs=Server.CreateObject("adodb.recordset")
sql="select * from dataview where xsf=true and id="&m_ID
rs.open sql,conn,1,1
if not rs.eof then
Dname=rs("path")
else
Response.Write("no found")
Response.end
end if
rs.close:set rs=nothing
'******************************************************************
If Dname<>"" Then
'******************************下载文件存放的服务端目录
url=Server.MapPath(Dname)
else
Response.Write("no found")
Response.end
End If
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set fl=fso.getfile(url)
flsize=fl.size
flName=fl.name
Set fl=Nothing
Set fso=Nothing
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile url
Select Case lcase(Right(flName, 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 ".bmp"
ContentType = "image/bmp"
Case ".ppt"
ContentType = "application/vnd.ms-powerpoint"
Case ".mdb"
ContentType = "application/x-msaccess"
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=" & flName
Response.AddHeader "Content-Length", flsize
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
response.Clear()
objStream.Close
Set objStream = Nothing
%>
- Asp实现隐藏文件下载地址方法
- asp.net文件下载,实现隐藏文件下载地址
- ASP实现隐藏下载地址和防盗
- asp隐藏下载地址
- Asp中隐藏下载地址
- ASP和C#隐藏文件下载路径的方法
- ASP和C#隐藏文件下载路径的方法
- ASP和C#隐藏文件下载路径的方法
- ASP和C#隐藏文件下载路径的方法
- asp.net实现文件下载四方法
- Asp.net下实现隐藏真实下载地址(可以实现简单的防盗链)
- 通过隐藏iframe实现文件下载的js方法
- golang 静态文件隐藏下载地址
- ASP.NET 实现文件下载的几种方法
- ASP.NET上传下载文件,使用TransmitFile方法实现下载。
- 点击提示用户下载文件并隐藏文件地址
- C#隐藏文件下载路径的方法
- C#隐藏文件下载路径的方法
- Source Navigator
- PHP正则表达式收集
- JS正则表达式集合
- Java中Native关键字的作用
- [双语阅读]金融危机来袭 英国人“性”趣不减
- Asp实现隐藏文件下载地址方法
- Repeater浅议
- Flex中数据绑定技巧
- 编写高效的Android代码
- Objective-C的语法格式
- Asp中with的功能
- 跳转菜单(新页面打开)
- 符合标准的间隙滚动代码(兼容IE和FireFox)
- C++中的堆与栈