summaryrefslogtreecommitdiffstats
path: root/files/ajax
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-15 20:37:50 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-15 21:09:13 +0200
commit6173c0fbc262f0d02c45d9cf4e81b020ad839145 (patch)
tree7c453e5dce300051efbcc3721eec4d7306c6000d /files/ajax
parent2f1a06b2ee8b2022e71d8903fd5ce0ccf2f8c22f (diff)
downloadnextcloud-server-6173c0fbc262f0d02c45d9cf4e81b020ad839145.tar.gz
nextcloud-server-6173c0fbc262f0d02c45d9cf4e81b020ad839145.zip
a bit of refactoring for oc_filesystem and implement user quota
Diffstat (limited to 'files/ajax')
-rw-r--r--files/ajax/upload.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/files/ajax/upload.php b/files/ajax/upload.php
index 5dcd2f2b6af..4247aeca283 100644
--- a/files/ajax/upload.php
+++ b/files/ajax/upload.php
@@ -19,6 +19,16 @@ $files=$_FILES['files'];
$dir = $_POST['dir'];
if(!empty($dir)) $dir .= '/';
$error='';
+
+$totalSize=0;
+foreach($files['size'] as $size){
+ $totalSize+=$size;
+}
+if($totalSize>OC_Filesystem::free_space('/')){
+ echo json_encode( array( "status" => "error", "data" => array( "message" => "Not enough space available" )));
+ exit();
+}
+
$result=array();
if(strpos($dir,'..') === false){
$fileCount=count($files['name']);