Hi, is where folder and file delete function? I have found Filesystem::removeFolder(), but it didn't remove anything. So maybe you know. Thanks :)
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
File::onBeforeDelete(); So you call $file->delete();
Thanks for reply :) So final code for multi files and folders delete is:
$FilesAndFolders = File::get()->where("\"OwnerID\" =" .$memberID);
foreach($FilesAndFolders as $FileAndFolder){
$FileAndFolder->delete();
}
It will delete files and folders also remove all stored entries in database.
Bye bye :)