src/filesystem/UploadedFile.php
public function moveTo(string $destination): void
    {
        $destination = is_dir($destination) ? ("$destination/{$this->clientName}") : $destination;
        Filesystem::checkWritable(dirname($destination));
        if (!move_uploaded_file($this->path, $destination)) {
            throw new FilesystemException("Failed to move file {$this->path} to {$destination}");
        }
    }
public function moveTo(string $destination): void
    {
        $destination = is_dir($destination) ? ("$destination/{$this->clientName}") : $destination;
        Filesystem::checkWritable(dirname($destination));
        if (!move_uploaded_file($this->path, $destination)) {
            throw new FilesystemException("Failed to move file {$this->path} to {$destination}");
        }
    }
public function moveTo ( string $ destination ) : void { $ destination = is_dir ( $ destination ) ? ( "$destination/{$this->clientName}" ) : $ destination ; Filesystem :: checkWritable ( dirname ( $ destination ) ) ; if ( ! move_uploaded_file ( $ this -> path , $ destination ) ) { throw new FilesystemException ( "Failed to move file {$this->path} to {$destination}" ) ; } }
Move the uploaded file safely to another location.
Ensures that files were actually uploaded through PHP before moving them.

@param string $destination
@throws FilesystemException
@throws \ntentan\utils\exceptions\FileNotWriteableException
Move the uploaded file safely to another location . Ensures that files were actually uploaded through PHP before moving them .