PMC-1181
This commit is contained in:
@@ -39,6 +39,36 @@ class FilesManager extends Api
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload a file to templates or public files
|
||||
*
|
||||
* @url POST /:prj_uid/process-files-manager
|
||||
* @url POST /:prj_uid/process-files-manager/:main_path
|
||||
*
|
||||
* @param string $prj_uid
|
||||
* @param string $main_path
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function uploadDocumentToProject($prj_uid, $main_path = 'templates')
|
||||
{
|
||||
try {
|
||||
$userUid = $this->getUserId();
|
||||
$filesManager = new FilesManagerBusinessModel();
|
||||
$response = $filesManager->uploadFilesManager($userUid, $prj_uid, $main_path);
|
||||
} catch (ExceptionRestApi $e) {
|
||||
throw new RestException($e->getCode(), $e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a file in the File Manager.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user