server/apps/files/ajax/getstoragestats.php
2015-01-06 15:56:06 +01:00

17 lines
362 B
PHP

<?php
$dir = '/';
if (isset($_GET['dir'])) {
$dir = $_GET['dir'];
}
OCP\JSON::checkLoggedIn();
\OC::$server->getSession()->close();
// send back json
try {
OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics($dir)));
} catch (\OCP\Files\NotFoundException $e) {
OCP\JSON::error(['data' => ['message' => 'Folder not found']]);
}