Forums

ASP

This topic is locked

MultiDelete Plus by Piero Mattirolo

Posted 11 Oct 2007 07:19:47
1
has voted
11 Oct 2007 07:19:47 Ken Ryan posted:
MultiDelete Plus by Piero Mattirolo

I 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>
&lt;%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%&gt;
&lt;!--#include virtual="/Connections/connSite.asp" --&gt;
&lt;%
Response.Buffer=1
Dim strID,rsDel,File,sql
strID=Request("checkbox"
if strID &lt;&gt; "" 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()
%&gt;
&lt;%
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 " &"&lt;strong&gt;" & Temppath & "&lt;/strong&gt;" &". 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"
%&gt;
</font id=code></pre id=code>

Ken Ryan



Ken Ryan



Edited by - kryan on 11 Oct 2007 07:22:47

Reply to this topic