Just a suggestion to the developers, i'm sorry if this already exists or has been remarked elsewhere,
but i did not find it on the forum (besides that it was left up to the user to implement this himself in the connector):
in the AccessControl object it might be very natural and desirable to define:
'folderMaxCapacity' => '8MB',
'folderMaxFiles' => 15,
both restrictions avoid that a malicious user fills up your server harddrive.
For php i calculate that quickly as follows (useful perhaps for your backend coding):
echo "Folder $path = ".(filesize_r($path)/1024)." Kilobytes";
# count minus 3 because thumbs dir, dot and doubledot dirs are also counted in the path
echo "Nr of files in Folder $path = ".(count(scandir($path))-3);
with a snippet by Jonas Sweden in the PHP documentation:
# function filesize_r($path){
# if(!file_exists($path)) return 0;
# if(is_file($path)) return filesize($path);
# $ret = 0;
# foreach(glob($path."/*") as $fn)
# $ret += filesize_r($fn);
# return $ret;
#}
but i did not find it on the forum (besides that it was left up to the user to implement this himself in the connector):
in the AccessControl object it might be very natural and desirable to define:
'folderMaxCapacity' => '8MB',
'folderMaxFiles' => 15,
both restrictions avoid that a malicious user fills up your server harddrive.
For php i calculate that quickly as follows (useful perhaps for your backend coding):
echo "Folder $path = ".(filesize_r($path)/1024)." Kilobytes";
# count minus 3 because thumbs dir, dot and doubledot dirs are also counted in the path
echo "Nr of files in Folder $path = ".(count(scandir($path))-3);
with a snippet by Jonas Sweden in the PHP documentation:
# function filesize_r($path){
# if(!file_exists($path)) return 0;
# if(is_file($path)) return filesize($path);
# $ret = 0;
# foreach(glob($path."/*") as $fn)
# $ret += filesize_r($fn);
# return $ret;
#}
Re: Limit file count & total size of folders? (feature reque
Are there any plans to support this feature in the future?
Re: Limit file count & total size of folders? (feature reque
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+