take free disk space (and user quota) into account for max upload size

This commit is contained in:
Robin Appelman 2011-11-08 22:48:29 +01:00
parent 452a463764
commit 2bd28acdc6
1 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,10 @@ $upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'
$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); $post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size); $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace=OC_Filesystem::free_space('/');
$freeSpace=max($freeSpace,0);
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
$tmpl = new OC_Template( "files", "index", "user" ); $tmpl = new OC_Template( "files", "index", "user" );
$tmpl->assign( "fileList", $list->fetchPage() ); $tmpl->assign( "fileList", $list->fetchPage() );
$tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() ); $tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );