📄 upload.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file="../inc/head.asp"-->
<!--#include file="../inc/upload_5xsoft.inc"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加图片</title>
</head>
<body bgcolor="#D4DOC8">
<%call f%><%opendata
set cn1=server.createobject("adodb.command")
cn1.activeconnection=cn
cn1.commandtype=1
cn1.commandtext="select * from shezhi"
set cn2=cn1.execute
if not cn2.eof then
z_name=cn2("mingchen")
z_logo=cn2("logo")
z_lei=cn2("lei")
z_max=cn2("smax")
end if
set cn2=nothing
set cn1=nothing
set cn1=server.createobject("adodb.command")
cn1.activeconnection=cn
cn1.commandtype=1
cn1.commandtext="select * from shuiying"
set cn2=cn1.execute
if not cn2.eof then
s_s=cn2("shuiying")
s_word=cn2("wenzi")
s_x=cn2("x")
s_y=cn2("y")
s_family=cn2("ziti")
s_bold=cn2("jiachu")
end if
set cn2=nothing
set cn1=nothing
closedata
%>
<%
set upload=new upload_5xsoft
dim wid,mingchen,g,sc,dizhi,id,sy,s_geshi,s_s_geshi
s_geshi="jpeg,jpg,gif,bmp,tiff,png"
id=checkstr(upload.form("id"))
g=checkstr(upload.form("g"))
s_s_geshi=split(s_geshi,",")
g=clng(g)
for i=1 to g
set file= upload.file("file"&i)
geshi=lcase(mid(file.filename,instrrev(file.filename,".")+1))
sc=false
z_geshi=split(z_lei,",")
for ii=0 to ubound(z_geshi)
if geshi=z_geshi(ii) then
sc=true
exit for
end if
next
if sc=false then
response.write("文件"&i&"上传失败,不允许上传该类文件<br/>")
fa
else
if file.filesize<0 or file.filesize>z_max then
response.write("文件"&i&"上传失败,文件太大或太小<br/>")
fa
else
file.saveas server.mappath("../file/"&id&"_"&i&"."&geshi)
response.write("文件"&i&"上传成功<br/>")
fa
d_dizhi="file/"&id&"_"&i&"."&geshi
if s_s ="true" then
sy=false
for iii=0 to ubound(s_s_geshi)
if s_s_geshi(iii)=geshi then
sy=true
exit for
end if
next
if sy=false then
response.write("ASPJPEG不支持该格式图片生成水印,添加水印失败<br/>")
else
Set Jpeg = Server.CreateObject("Persits.Jpeg")
Jpeg.Open Server.MapPath("../file/"&id&"_"&i&"."&geshi)
Jpeg.Canvas.Font.Family = s_family
Jpeg.Canvas.Font.Bold = cbool(s_bold)
Jpeg.Canvas.Print s_x,s_y,s_word
jpeg.save Server.MapPath("../file/"&id&"_"&i&".jpg")
jpeg.close
set jpeg=nothing
d_dizhi="file/"&id&"_"&i&".jpg"
response.write("水印生成成功.<br/>")
fa
end if
end if
if i=1 then
dizhi=d_dizhi
else
dizhi=dizhi&","&d_dizhi
end if
end if
end if
next
if session("q")="1" then
zhuangtai="1"
else
zhuangtai="0"
end if
opendata
cn.execute("update tu set dizhi='"&dizhi&"' where id="&id)
closedata
response.write("更新数据库成功<br/>")
%>
<a href="tp.asp">返回图片管理</a><br/>
<a href="shouye.asp">返回管理首页</a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -