⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showimg.asp

📁 功能强大的bbs
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/dv_clsother.asp" -->
<%
If Dvbbs.BoardID=0 Then
	Response.Write("<h1>错误: </h1>参数错误。")
	Response.End
End If
Dim filename
filename=Request("filename")
filename=Replace(filename,"..","")
If Request.ServerVariables("HTTP_REFERER")="" Or InStr(Request.ServerVariables("HTTP_REFERER"),Request.ServerVariables("SERVER_NAME"))=0 Or filename="" Then
	Call downloadFile(Server.MapPath(Dvbbs.Forum_Info(6)))
Else
	If Dvbbs.Forum_Setting(76)="" Or Dvbbs.Forum_Setting(76)="0" Then Dvbbs.Forum_Setting(76)="UploadFile/"
	If right(Dvbbs.Forum_Setting(76),1)<>"/" Then Dvbbs.Forum_Setting(76)=Dvbbs.Forum_Setting(76)&"/"
	Call downloadFile(Server.MapPath(Dvbbs.Forum_Setting(76)&filename))
End If
Sub downloadFile(strFile)
	On error resume next
	Server.ScriptTimeOut=999999
	Dim S,fso,f,intFilelength,strFilename
	strFilename = strFile
	Response.Clear
	Set s = Server.CreateObject("ADODB.Stream") 
	s.Open
	s.Type = 1 
	Set fso = Server.CreateObject("Scripting.FileSystemObject") 
	If Not fso.FileExists(strFilename) Then
		Call downloadFile(Server.MapPath(Dvbbs.Forum_Info(6)))
		Exit Sub		
	End If
	Set f = fso.GetFile(strFilename)
		intFilelength = f.size
		s.LoadFromFile(strFilename)
		If err Then
		 	Response.Write("<h1>错误: </h1>" & err.Description & "<p>")
			Response.End 
		End If
		Set fso=Nothing
		Dim Data
		Data=s.Read
		s.Close
		Set s=Nothing
		If Response.IsClientConnected Then 
			'Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name 
			Response.AddHeader "Content-Length", intFilelength 
 			Response.CharSet = "UTF-8" 
			Response.ContentType = "application/octet-stream"
			Response.BinaryWrite Data
			Response.Flush
		End If
End Sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -