You are here

protected function UploaderServlet::getReq in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

1 call to UploaderServlet::getReq()
UploaderServlet::doPost in vendor/edsdk/file-uploader-server-php/src/servlet/UploaderServlet.php

File

vendor/edsdk/file-uploader-server-php/src/servlet/UploaderServlet.php, line 43

Class

UploaderServlet

Namespace

EdSDK\FileUploaderServer\servlet

Code

protected function getReq($post, $files) {
  $req = null;
  try {
    $req = $this->m_json
      ->fromJson($post['data']);
    if ($this->m_config
      ->isTestAllowed()) {
      if (array_key_exists("test_serverConfig", $req)) {
        $this->m_config
          ->setTestConfig($req->test_serverConfig);
      }
      if (array_key_exists("test_clearAllFiles", $req)) {
        $this
          ->clearAllFiles();
      }
    }
  } catch (Exception $e) {
    error_log($e);
    return null;
  }
  if (array_key_exists('file', $files)) {
    $req->m_file = $files['file'];

    //$this->getFileInfo($files['file']);
    $req->m_fileName = $req->m_file['name'];
    $req->m_fileSize = $req->m_file['size'];
  }
  return $req;
}