⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 attach_del.asp

📁 是一个关于小学信息化教育的平台,提供了学校论坛,和聊天室功能!
💻 ASP
字号:
<!--#INCLUDE FILE="../../INCLUDE/DB.ASP"-->
<!--#INCLUDE FILE="power.ASP"-->
<%

Set conn = OpenOrGet_Database("sql_conn")

myid=trim(request("id"))
if myid="" or (not isnumeric(myid)) then
     Response.Write "<script language=javascript>"
      Response.Write "alert('没有相关记录,请重新选择!!');"
      Response.Write "history.go(-1);"
      Response.Write "</script>"
	  Response.End
end if
checksql="select id,attach from content where id='"&myid&"'"
set Rs=open_rs(conn,checksql)
if Rs.eof then
     Response.Write "<script language=javascript>"
      Response.Write "alert('没有相关记录,请重新选择!!');"
      Response.Write "history.go(-1);"
      Response.Write "</script>"
	  Response.End
end if

downdir=rs("attach")
attach=trim(request("attach"))
downDirArr=split(downdir,",")

For i=0 to ubound(downDirArr)	
	if downDirArr(i)=attach then
		imagepath ="/admin/content/"
		'检索图片实体是否存在
		set checkFile=Server.createObject("Scripting.FileSystemObject")
		if checkFile.fileExists(server.mappath(imagepath&downDirArr(i))) then
			checkFile.deleteFile server.mappath(imagepath&downDirArr(i))
		end if
		downDirArr(i)=""
	end if
next

downdir=""
for i=0 to ubound(downDirArr)
	if downdir="" and downDirArr(i)<>"" then
		downDir=downDirArr(i)
	else
		if downDirArr(i)<>"" then
			downDir=downDir&","&downDirArr(i)
		end if
	end if
next

rs("attach")=downdir
rs.update

response.redirect "content_modi.asp?id="&myid
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -