<!--#include file="../conn.asp"-->
<!--#include file="../admin.asp"-->

<%call head()
dim TP,ids,Action,path
Action=Request.QueryString("Action")
TP=trim(request("TP"))
PIC=trim(request("PIC"))
ids=trim(request("ids"))
id=trim(request("id"))
path=trim(request.querystring("path"))
pathsmall=trim(request.querystring("pathsmall"))
if pathsmall="" then
  Call Error("相片缩略图地址无效！")
  end if
if path="" then
  Call Error("文件地址无效！")
  end if
Call saycarda("删除相片")
if ids="" or IsNumeric(ids)=False then
  Call Error("无效相片！")
end if
'检查文件是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id,photoview FROM Upfile where id="&ids,conn,1,1
if rs.eof Then
  Call Error("相片数据不存在！")
  rs.close
  set rs=Nothing

end if
path=Server.MapPath(path)
Set fso=server.CreateObject("Scripting.FileSystemObject")
	IF (fso.FileExists(path)) Then
	Set delfile = fso.GetFile(path)
	delfile.Delete
	set delfile=nothing
	
	else
	response.write(path & "相片文件不存在了！<br/>")
	end if
set fso=nothing
pathsmall=Server.MapPath(pathsmall)
Set fso=server.CreateObject("Scripting.FileSystemObject")
	IF (fso.FileExists(pathsmall)) Then
	Set delfile = fso.GetFile(pathsmall)
	delfile.Delete
	set delfile=nothing
	
	else
	response.write(path & "相片文件不存在了！<br/>")
	end if
set fso=Nothing
conn.Execute"delete from upfile where id="&ids&" "
 Response.Write "相片册除成功！"
 Response.Write "<br/><a href=""photolist.asp?saytk="&saytk&"&amp;sid="&sid&""">相册管理</a>"

conn.close
set conn=Nothing
Call headsay()
%>
