Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

multiple record and associated file deletes

Posted 25 Jan 2002 14:05:52
1
has voted
25 Jan 2002 14:05:52 David Behan posted:
Can anyone help me how to delete multiple records at the same time and also delete any image that has been uploaded and associated with these records (as file name will be saved in database.

I already have the multiple delete function working, now I need it to delete the files associated so I don't take up too much server space.

Any suggestions???



_______________________
David Behan - [url]bmor.com[url]

Edited by - beano on 25 Jan 2002 14:07:55

Edited by - beano on 25 Jan 2002 14:08:14

Replies

Replied 28 Jan 2002 15:56:35
28 Jan 2002 15:56:35 Piero Mattirolo replied:
You may read my tutorial at www.admil.com/tutorial/multideleteplus.html and there is a new extension there

pm

Replied 28 Jan 2002 16:06:06
28 Jan 2002 16:06:06 David Behan replied:
Try that before but script kept timing out. It would delete the entry in the database but it won't delete the file associated with it. Permissions setup correctly so I don't know.

Any extra advice????

_________________________
David Behan - www.bmor.com
Replied 28 Jan 2002 17:16:22
28 Jan 2002 17:16:22 Viktor Farcic replied:
To delete files from server use something like:
<%
Function NewFileSystemObject()
set NewFileSystemObject=Server.CreateObject("Scripting.FileSystemObject"
End Function

Function FileExists(aFileSpec)
FileExists=NewFileSystemObject.FileExists(aFileSpec)
End Function
%>
<%
' ****************************************
' * Change PATH & FILENAME to real values
' ****************************************
Set File = CreateObject("Scripting.FileSystemObject"
ImagePath = Server.MapPath(PATH)
ImagePath = ImagePath & "\" & FILENAME
If FileExists(ImagePath) Then
File.DeleteFile(ImagePath)
End If%>
%>


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Can anyone help me how to delete multiple records at the same time and also delete any image that has been uploaded and associated with these records (as file name will be saved in database.

I already have the multiple delete function working, now I need it to delete the files associated so I don't take up too much server space.

Any suggestions???
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager

Edited by - vfarcic on 28 Jan 2002 17:18:58

Reply to this topic