aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--files/index.php4
1 files changed, 4 insertions, 0 deletions
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() );