diff options
Diffstat (limited to 'files/ajax/upload.php')
-rw-r--r-- | files/ajax/upload.php | 10 |
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']); |