You are here

public function FileUploaded::commit in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Commits a file.

File

src/Flmngr/FileUploaderServer/lib/file/FileUploaded.php, line 142

Class

FileUploaded
Uploaded but not commited yet file. Data stucture about file is to be converted to commited file when all validations are passed.

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\lib\file

Code

public function commit($dir, $autoRename) {
  $file = $this
    ->getCommitedFile($dir);
  if ($autoRename) {
    $file
      ->setFreeFileName();
  }
  $this
    ->copyTo($file);
  return $file;
}