. * */ OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); \OC::$server->getSession()->close(); $files = new \OCA\Files\App( \OC\Files\Filesystem::getView(), \OC_L10n::get('files') ); $result = $files->rename( $_GET["dir"], $_GET["file"], $_GET["newname"] ); if($result['success'] === true){ OCP\JSON::success(array('data' => $result['data'])); } else { OCP\JSON::error(array('data' => $result['data'])); }