src/Tus/Client.php
public function file(string $file, string $name = null) : self
    {
        $this->filePath = $file;

        if ( ! file_exists($file) || ! is_readable($file)) {
            throw new FileException('Cannot read file: ' . $file);
        }

        $this->fileName = $name ?? basename($this->filePath);
        $this->fileSize = filesize($file);

        return $this;
    }
public function file(string $file, string $name = null) : self
    {
        $this->filePath = $file;

        if ( ! file_exists($file) || ! is_readable($file)) {
            throw new FileException('Cannot read file: ' . $file);
        }

        $this->fileName = $name ?? basename($this->filePath);
        $this->fileSize = filesize($file);

        return $this;
    }
public function file ( string $ file , string $ name = null ) : self { $ this -> filePath = $ file ; if ( ! file_exists ( $ file ) || ! is_readable ( $ file ) ) { throw new FileException ( 'Cannot read file: ' . $ file ) ; } $ this -> fileName = $ name ?? basename ( $ this -> filePath ) ; $ this -> fileSize = filesize ( $ file ) ; return $ this ; }
Set file properties.

@param string $file File path.
@param string $name File name.

@return Client
Set file properties .