summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/upload.php
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-03 12:23:29 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-03 12:23:29 +0200
commit43caa3b3b9cc9dbbf73ab2f6695a801a07a1dba5 (patch)
treef4b191f0d039cb7de942554ea23df3fff9de7ad6 /apps/files/ajax/upload.php
parent375ba986452b190745b9388be92737d7e5771673 (diff)
downloadnextcloud-server-43caa3b3b9cc9dbbf73ab2f6695a801a07a1dba5.tar.gz
nextcloud-server-43caa3b3b9cc9dbbf73ab2f6695a801a07a1dba5.zip
ported oc_json
Diffstat (limited to 'apps/files/ajax/upload.php')
-rwxr-xr-xapps/files/ajax/upload.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index ca64f58e14b..d6c799af32c 100755
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -4,12 +4,12 @@
// Firefox and Konqueror tries to download application/json for me. --Arthur
-OC_JSON::setContentTypeHeader('text/plain');
+OCP\JSON::setContentTypeHeader('text/plain');
-OC_JSON::checkLoggedIn();
+OCP\JSON::checkLoggedIn();
if (!isset($_FILES['files'])) {
- OC_JSON::error(array("data" => array( "message" => "No file was uploaded. Unknown error" )));
+ OCP\JSON::error(array("data" => array( "message" => "No file was uploaded. Unknown error" )));
exit();
}
foreach ($_FILES['files']['error'] as $error) {
@@ -24,7 +24,7 @@ foreach ($_FILES['files']['error'] as $error) {
UPLOAD_ERR_NO_TMP_DIR=>$l->t("Missing a temporary folder"),
UPLOAD_ERR_CANT_WRITE=>$l->t('Failed to write to disk'),
);
- OC_JSON::error(array("data" => array( "message" => $errors[$error] )));
+ OCP\JSON::error(array("data" => array( "message" => $errors[$error] )));
exit();
}
}
@@ -38,7 +38,7 @@ foreach($files['size'] as $size){
$totalSize+=$size;
}
if($totalSize>OC_Filesystem::free_space('/')){
- OC_JSON::error(array("data" => array( "message" => "Not enough space available" )));
+ OCP\JSON::error(array("data" => array( "message" => "Not enough space available" )));
exit();
}
@@ -52,12 +52,12 @@ if(strpos($dir,'..') === false){
$result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'],'name'=>basename($target));
}
}
- OC_JSON::encodedPrint($result);
+ OCP\JSON::encodedPrint($result);
exit();
}else{
$error='invalid dir';
}
-OC_JSON::error(array('data' => array('error' => $error, "file" => $fileName)));
+OCP\JSON::error(array('data' => array('error' => $error, "file" => $fileName)));
?>