Forums
This topic is locked
MultiDelete Plus by Piero Mattirolo
11 Oct 2007 07:19:47 Ken Ryan posted:
MultiDelete Plus by Piero MattiroloI am using the MultiDelete Plus extension to delete multiple rows and multiple images assocaited with those files. But how do I delete the thumbs as well. The have a _small at the end of them. ie Dustin_small.jpg Here is my code. Any help would be greatly appreciated.
<pre id=code><font face=courier size=2 id=code>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="/Connections/connSite.asp" -->
<%
Response.Buffer=1
Dim strID,rsDel,File,sql
strID=Request("checkbox"
if strID <> "" then
Set File = CreateObject("Scripting.FileSystemObject"
Set rsDel= Server.CreateObject("ADODB.Recordset"
rsDel.ActiveConnection = MM_connSite_STRING
sql="SELECT * FROM tblPictures WHERE PIC_ID IN "
sql=sql &"(" & strID & ""
rsDel.Source = sql
rsDel.LockType = 3
rsDel.open()
%>
<%
Do While rsDel.EOF=False
dim TempPath
TempPath=(Server.Mappath(("../../images/gallery" &"/" & rsDel("PIC_IMAGE"))
rsDel.Delete
if File.FileExists(TempPath)=true then
File.DeleteFile(TempPath)
rsDel.MoveNext
Else
response.write "Error: no file found at the address " &"<strong>" & Temppath & "</strong>" &". The corresponding record was deleted."
Exit Do
End if
Loop
rsDel.Close
Set File=Nothing
Set rsDel=Nothing
else Response.redirect("/admin/gallery/cat.asp?delete=yes"
end if
Response.Redirect "/admin/gallery/cat.asp?delete=yes"
%>
</font id=code></pre id=code>
Ken Ryan
Ken Ryan
Edited by - kryan on 11 Oct 2007 07:22:47