<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="uploadfile_inc.asp"-->
<!--#include file="function.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	nn=""
	formsize = request.totalbytes
	formdata = request.binaryread(formsize)
	bcrlf = chrb(13) & chrb(10)
	divider = leftb(formdata, instrb(formdata, bcrlf) - 1)
	If GetFormVal("name")="" Then 
		response.write "<script language=javascript>alert('请填写图片名称！');location.href='javascript:history.back()';</script>"
		response.end 
	end if
	path = Server.MapPath("..\upimages\school")
	filename = SaveFile("attachment",path,500)
	if filename = "" then error ="图片大小不要超过500K！返回重新输入"
	if error <> "" then
		response.write "<script language=javascript>alert('"&error&"');location.href='javascript:history.back()';</script>"
		response.end
	end if
	Set rs= Server.CreateObject("ADODB.Recordset")
	sql="select * from school_photo"
	rs.open sql,conn,2,3
	rs.addnew
	rs("pname")=GetFormVal("name")
	rs("url")=nn
	rs("sid")=Request.Cookies("admin_school_id")
	rs("zhuangtai")=1
	rs("lock")=int(school_photo_open)
	rs("stime")=now()
	rs.update
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	response.redirect "picture_all.asp"
	response.end
%>
