summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/ajax/upload.php')
-rw-r--r--apps/files/ajax/upload.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 74e6eb560d8..813a6c67b5c 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -38,24 +38,24 @@ $totalSize=0;
foreach($files['size'] as $size){
$totalSize+=$size;
}
-if($totalSize>OC_Filesystem::free_space('/')){
+if($totalSize>OC_Filesystem::free_space('/')) {
OCP\JSON::error(array("data" => array( "message" => "Not enough space available" )));
exit();
}
$result=array();
-if(strpos($dir,'..') === false){
+if(strpos($dir, '..') === false) {
$fileCount=count($files['name']);
for($i=0;$i<$fileCount;$i++){
$target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
- if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i],$target)){
+ if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) {
$meta=OC_FileCache_Cached::get($target);
$result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'],'name'=>basename($target));
}
}
OCP\JSON::encodedPrint($result);
exit();
-}else{
+} else {
$error='invalid dir';
}