src/PutIO/Engines/PutIO/FilesEngine.php
public function upload($file, $parentID = 0)
    {
        if (!$file = realpath($file)) {
            throw new \Exception('File not found');
        }

        return $this->uploadFile('files/upload', [
            'parent_id' => $parentID,
            'file'      => "@{$file}"
        ]);
    }
public function upload($file, $parentID = 0)
    {
        if (!$file = realpath($file)) {
            throw new \Exception('File not found');
        }

        return $this->uploadFile('files/upload', [
            'parent_id' => $parentID,
            'file'      => "@{$file}"
        ]);
    }
public function upload ( $ file , $ parentID = 0 ) { if ( ! $ file = realpath ( $ file ) ) { throw new \ Exception ( 'File not found' ) ; } return $ this -> uploadFile ( 'files/upload' , [ 'parent_id' => $ parentID , 'file' => "@{$file}" ] ) ; }
Uploads a local file to your account.

NOTE 1: The response differs based on the uploaded file. For regular
files, the array key containing the info is 'file', but for torrents it's
'transfer'.

@see https://api.put.io/v2/docs/#files-upload

NOTE 2: Files need to be read into the memory when using NATIVE
functions. Keep that in mind when uploading large files or running
multiple instances.

@param string  $file        Path to local file.
@param integer $parentID    ID of upload folder.
@return mixed
@throws \Exception
Uploads a local file to your account .