public function copyfileAction() { $upload_dir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload"; $filename = $this->_getParam('name'); StoredFile::copyFileToStor($upload_dir, $filename); die('{"jsonrpc" : "2.0"}'); }
public function uploadFileAction() { global $CC_CONFIG; $api_key = $this->_getParam('api_key'); if (!in_array($api_key, $CC_CONFIG["apiKey"])) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; exit; } $upload_dir = ini_get("upload_tmp_dir"); StoredFile::uploadFile($upload_dir); $fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : ''; StoredFile::copyFileToStor($upload_dir, $fileName); }