From 2bd28acdc6a1cb4aacd76790705895f20dc05533 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 8 Nov 2011 22:48:29 +0100 Subject: take free disk space (and user quota) into account for max upload size --- files/index.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'files') diff --git a/files/index.php b/files/index.php index 8bb5b618d87..4b3bbd1bfd4 100644 --- a/files/index.php +++ b/files/index.php @@ -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')); $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->assign( "fileList", $list->fetchPage() ); $tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() ); -- cgit v1.2.3