📄 certificatesave.asp
字号:
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/Commoncode.asp"-->
<!--#include file="../inc/CommonFunction.asp"-->
<%
link="person_certificate.asp"
sUploadDir=UpFilesPath("Person")
%>
<!--#include file="checkpmember.asp" -->
<!--#include file="uploadfile_inc.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>保存证书</title>
</head>
<body>
<%
picture_certiid=cint(trim(request("certiid")))
nn=""
formsize = request.totalbytes
formdata = request.binaryread(formsize)
bcrlf = chrb(13) & chrb(10)
divider = leftb(formdata, instrb(formdata, bcrlf) - 1)
path = Server.MapPath(sUploadDir)
filename = SaveFile("attachment",path,100)
if filename = "" then error ="<p align=center><font color=red>图片大小不要超过100K!点击<a href='javascript:history.back()'>这里</a>返回重新输入</font></p>"
if error <> "" then
response.write "<br><br>"
response.write error
response.end
end if
%>
<%
Set rs= Server.CreateObject("ADODB.RecordSet")
sql="select * from job_p_picture where picture_pmember='"&pmember_login&"' and picture_type=2 and picture_certiid="&picture_certiid&""
rs.open sql,conn,3,3
if rs.eof then '不存在则添加
rs.addnew
rs("picture_type")=2
rs("picture_filename")=nn
rs("picture_certiid")=picture_certiid
rs("picture_status")=0
rs("picture_pmember")=pmember_login
rs.update
else
prepicture=rs("picture_filename")
if prepicture<>"" and not isnull(prepicture) then '原来有图片
set fileobject=server.createobject("scripting.filesystemobject")
path=Server.MapPath(sUploadDir&prepicture)
if fileobject.fileexists(path) then
set afile=fileobject.getfile(path)
afile.delete
end if
end if
rs("picture_filename")=nn
rs("picture_announcedate")=now()
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "person_certificate.asp"
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -