上传图片自动加水印,进来看下
发布网友
发布时间:2022-04-19 23:42
我来回答
共1个回答
热心网友
时间:2022-04-20 01:11
<%
set upload=new upload_Cnese
set file=upload.file(\"file1\")
formPath=\"/UploadFiles/Proct/\"
if file.filesize>100 then
fileExt=lcase(right(file.filename,3))
if fileExt=\"asp\" then
Response.Write\"文件类型非法\"
end if
end if
randomize
ranNum=int(90000*rnd)+10000
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&\".\"&fileExt
if file.FileSize>0 then
file.SaveAs Server.mappath(FileName)
Set Jpeg = Server.CreateObject(\"Persits.Jpeg\")
Jpeg.Open Server.MapPath(filename)
Jpeg.Canvas.Font.Color = &Hff0000\' red
Jpeg.Canvas.Font.Family = \"宋体\"
Jpeg.Canvas.Font.Bold = True
Jpeg.Canvas.Print 10, 10, \"JxGx.Net\"
Jpeg.Canvas.Pen.Color = &H000000
Jpeg.Canvas.Pen.Width = 2
Jpeg.Canvas.Brush.Solid = False
Jpeg.Canvas.Bar 1, 1, Jpeg.Width, Jpeg.Height
Jpeg.Save Server.MapPath(filename)
end if
%>