Delete multiple records and associated files
Can Data Bridge delete files associated with records when using the Multiple File Delete SB?
Not sure if this is integrated now with the File Manipulation > Delete File
Can Data Bridge delete files associated with records when using the Multiple File Delete SB?
Not sure if this is integrated now with the File Manipulation > Delete File
You would need to hand code this.
you would need to loop through the ID's of the records being deleted, in the loop, use a recordset to find the file name and delete the file.
I been trying to do this but with no luck since the new way data assist works with that popup delete thing unless i send the user to a page that has the behavior on page load how can we do this to delete all associated files from records.
i have try
showthread.php?t=24685&highlight=delete
also
t-27281.html
No luck so far if i dont do a new page that has everything on pageload then redirect to a page to delete records but this way i cant even ask the user if he is sure cause the methods on those other post dont work with a submit button and with submit button i can not add the record directly dunno why only a form field with the name of the file to delete
the id of the record to delete is passed to the delete behavior in a form element named:
WADADeleteRecordID
you would need to create a recordset that returns the file names, use the WADADeleteRecordID form element to filter the ID column of the recordset
then hand code logic to loop through the recordset, and delete the files.
I tried that already the only problem is that it does not delete all the files it seems that it looks for form elements and not acepts me to put the recordset directly
well, like i said, you need to hand code the loop through the recordset to do the delete.
the first link in your message was good example.
For anyone else searching for this, here is a link to an example of how to hand code the loop to delete multiple files: showthread.php?t=27281&highlight=loop+file+delete
I also found that you can delete from multiple folders by adding additional $WA_DeleteFileResults
<?php do { ?>
<?php
$WA_DeleteFileResult1 = false;
$WA_DeleteFileResult2 = false;
if(!($totalRows_rsLBimageDelete == 0)){
$WA_DeleteFileResult1 = WA_FileAssist_DeleteFile("../images/lookbook/img/", "".$row_rsLBimageDelete['imagelImage'] ."");
$WA_DeleteFileResult2 = WA_FileAssist_DeleteFile("../images/lookbook/img/thumbnail/", "".$row_rsLBimageDelete['imagelImage'] ."");
}
?>
<?php } while ($row_rsLBimageDelete = mysql_fetch_assoc($rsLBimageDelete)); ?>
Anyone please chime in if there's a better way to do it.
reopening this thread i still not able to delete files when they are linked to another table that is suppose to be deleted i tried what every post here says without any luck added an attachment to see where i am wrong
the recordsets you have to lookup the files to delete are being filtered on a URL variable, that URL variables probably doesn't exist when the delete button pressed.
try using the WADADeleteRecordID post element instead.
Thank you Jason that seem to do the trick
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.