For an introduction how file-uploads work read:
http://wiki.pixtur.de/index.php/File_uploadsCurrently there is no way to remove files from the server. The items are just marked as deleted:
$file->delete();
Which does something like:
$item->state = -1
$item->update()
The item is not(!) been removed from the database and it could be restored everytime. This leeds to the problem, that old files might collect in the _files/ directory and we need a function to go through all files like.
$files= File::getFiles(array(
'state' => STATE_DELETED,
'view_all' => true,
));
First this request-type has to be added to the getFiles()-function (see db/class_file.inc). Another (slower) way of doing this might be:
if($files= File::getAll(array(
'view_all'=> true,
))) {
foreach($files as $f) {
if($f->state =-1) {
unline($f->tmp_file_name);
}
}
}
We need a function which is only be accessible for admins (see
project options (additional page) for pms and admins) to place this function into the interface.