<!--#include file="Save.asp"-->
<!--#include file="WebConfig/Conn.asp"-->
<%
	dim text1, upfile1
	dim formDataList, formFileList
	dim formDivider(1)
	
	Set formDataList = CreateObject("Scripting.Dictionary") '数据保存
	Set formFileList = CreateObject("Scripting.Dictionary") '数据保存
	saveFolder="upimages/"
	'Response.Write(Len(formFileList("ExcelFile")))
	'Response.End()
	If len(getFormData(formDataList, formFileList, formDivider)) = 0 then
		upFileName= saveFile(formFileList("ExcelFile"),saveFolder, formDataList("ExcelFile"))
	End if
	If upFileName="" Then
		fileName=""
	Else
		fileName=right(upFileName,len(upFileName)-len(saveFolder))	
	End If
	'Response.Write(fileName)
	'Response.End()	
	Title = formDataList("title")
	Pclass = formDataList("class")
	url = upFileName
	if title="" or url="" then
	Response.Write "<script language=javascript>alert('标题不能为空!!');location.href='photo.asp';</script>"
	else
	Set rsReply=Server.CreateObject("ADODB.RecordSet")	
		rsReply.Open "Select * from photo",conn,1,3
		rsReply.Addnew
		rsReply("addTime")=now
		rsReply("title")=Title
		rsReply("class")=Pclass
		rsReply("url")=url
	rsReply.Update
	rsReply.Close
	Set rsReply=Nothing
	Response.Write "<script language=javascript>alert('添加图片成功!!');location.href='photo.asp';</script>"
	end if
%>