海外邮件中继,海外退信中继,美国高速VPS,不限流量VPN,邮局维护和管理,邮件网关,EMOS邮件中继,POSTFIX邮件中继,Winwebmail邮件中继,Winmail邮件中继,DBMail邮件中继,JDMail邮件中继,Exchange邮件中继,MDaemon邮件中继 淘宝店:http://shantan.taobao.com 云邮科技官网:www.yunrelay.com
【字体设置:大 中 小】
功能描述:上传图片文件到指定目录后,在本文件根据URL传入的文件名加上文件所在目录根据文件完整路径。再将该文件二进制数据流写入服务页面,从而达到隐藏图片真实地址防止外部引用图片的效果。程序代码: [ 复制代码到剪贴板 ]
<%
Option Explicit
Const SysUrl="http://www.80Boby.com/uImg/"
Function ReadBinFile(fileName)
Dim objStream,bin
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile fileName
bin = objStream.Read
objStream.Close
ReadBinFile = bin
End Function
Function isSelfRefer()
Dim sHttp_Referer, sServer_Name
sServer_Name = CStr(Request.ServerVariables("HTTP_REFERER"))
if instr(sServer_Name,"80boby.com")<>0 or instr(sServer_Name,"freeat63.cn")<>0 then
IsSelfRefer = True
Else
IsSelfRefer = False
End If
End Function
if request.QueryString("Mark")="getPic" then
Dim RealUrl,fso
Dim uFileName:uFileName=Request.QueryString("x")
RealUrl=Server.MapPath("文件真实路径"&uFileName)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if Not(fso.FileExists(RealUrl)) then RealUrl=Server.MapPath("logo.gif")
if Not(isSelfRefer) then
RealUrl=Server.MapPath("logo.gif")
end if
response.contenttype = "image/jpeg"
response.BinaryWrite ReadBinFile(RealUrl)
response.end
end if
%>
发表评论 - 不要忘了输入验证码哦!