I've built a content management system in PHP and MySQL using FCKEditor and CKFinder. Both of which work great!
Now, I would like to create a page where my client can add photo galleries. Each photo will be associated with a particular gallery in the database. But when my client deletes a gallery, I'd like to have CKFinder delete all files associated with that gallery?
Does that make sense?
Thanks in advance for any help!
Now, I would like to create a page where my client can add photo galleries. Each photo will be associated with a particular gallery in the database. But when my client deletes a gallery, I'd like to have CKFinder delete all files associated with that gallery?
Does that make sense?
Thanks in advance for any help!

Re: Dynamically Delete Files?
http://docs.fckeditor.net/CKFinder/Serv ... ntegration
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: Dynamically Delete Files?
Re: Dynamically Delete Files?
Take a look at core\connector\php\phpX\Utils\FileSystem.php, there is a special unlink method that deletes a folder.
Adjust it to your needs and call it inside of your application, e.g.
function myunlink($path) { /* make sure the path exists */ if(!file_exists($path)) { return false; } /* If it is a file or link, just delete it */ if(is_file($path) || is_link($path)) { return @unlink($path); } /* Scan the dir and recursively unlink */ $files = scandir($path); if ($files) { foreach($files as $filename) { if ($filename == '.' || $filename == '..') { continue; } $file = str_replace('//','/',$path.'/'.$filename); myunlink($file); } } /* Remove the parent dir */ if(!@rmdir($path)) { return false; } return true; } //example if ( !myunlink("/path/to/dir") ) { echo "something went wrong, check permissions"; } else { echo "folder deleted"; }Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+