public function uploadAction()
 {
     $upload_dir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
     StoredFile::uploadFile($upload_dir);
     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);
 }