You are here

public function ActionUploadRemoveFile::run in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

Overrides AAction::run

File

vendor/edsdk/file-uploader-server-php/src/lib/action/ActionUploadRemoveFile.php, line 23

Class

ActionUploadRemoveFile

Namespace

EdSDK\FileUploaderServer\lib\action

Code

public function run($req) {
  $this
    ->validateUploadId($req);
  $file = new FileUploaded($this->m_config, $req->uploadId, $req->name, $req->name);
  $file
    ->checkForErrors(true);
  if ($file
    ->getErrors()
    ->size() > 0) {
    throw new MessageException(Message::createMessageByFile(Message::UNABLE_TO_DELETE_UPLOAD_DIR, $file
      ->getData()));
  }
  $file
    ->delete();
  return new RespOk();
}