<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/Commoncode.asp"-->
<!--#include file="../inc/CommonFunction.asp"-->
<%link="person_photo.asp"
sUploadDir=UpFilesPath("Person")
%>
<!--#include file="checkpmember.asp" -->
<!--#include file="../inc/uploadfile_inc.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>保存照片</title>
</head>
<body>
<%On Error Resume Next
 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_member where Member_login='"&pmember_login&"' and Member_typeid=1"
rs.open sql,conn,3,3
 prepicture=rs("Member_logo")
 if prepicture<>"" and not isnull(prepicture) and prepicture<>"nophoto.gif" and prepicture<>"error.gif" 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("Member_logostatus")=1
 rs("Member_logo")=nn
 if AdminPicCheckReg=1 then
 rs("Member_logoflag")=0
 else
 rs("Member_logoflag")=1
 end if
 rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "person_photo.asp"
%>
</body>
</html>