src/Tus/Client.php
public function concat(string $key, ...$partials) : string
    {
        $response = $this->getClient()->post($this->apiPath, [
            'headers' => [
                'Upload-Length' => $this->fileSize,
                'Upload-Key' => $key,
                'Upload-Checksum' => $this->getUploadChecksumHeader(),
                'Upload-Metadata' => 'filename ' . base64_encode($this->fileName),
                'Upload-Concat' => self::UPLOAD_TYPE_FINAL . ';' . implode(' ', $partials),
            ],
        ]);

        $data       = json_decode($response->getBody(), true);
        $checksum   = $data['data']['checksum'] ?? null;
        $statusCode = $response->getStatusCode();

        if (HttpResponse::HTTP_CREATED !== $statusCode || ! $checksum) {
            throw new FileException('Unable to create resource.');
        }

        return $checksum;
    }
public function concat(string $key, ...$partials) : string
    {
        $response = $this->getClient()->post($this->apiPath, [
            'headers' => [
                'Upload-Length' => $this->fileSize,
                'Upload-Key' => $key,
                'Upload-Checksum' => $this->getUploadChecksumHeader(),
                'Upload-Metadata' => 'filename ' . base64_encode($this->fileName),
                'Upload-Concat' => self::UPLOAD_TYPE_FINAL . ';' . implode(' ', $partials),
            ],
        ]);

        $data       = json_decode($response->getBody(), true);
        $checksum   = $data['data']['checksum'] ?? null;
        $statusCode = $response->getStatusCode();

        if (HttpResponse::HTTP_CREATED !== $statusCode || ! $checksum) {
            throw new FileException('Unable to create resource.');
        }

        return $checksum;
    }
public function concat ( string $ key , ... $ partials ) : string { $ response = $ this -> getClient ( ) -> post ( $ this -> apiPath , [ 'headers' => [ 'Upload-Length' => $ this -> fileSize , 'Upload-Key' => $ key , 'Upload-Checksum' => $ this -> getUploadChecksumHeader ( ) , 'Upload-Metadata' => 'filename ' . base64_encode ( $ this -> fileName ) , 'Upload-Concat' => self :: UPLOAD_TYPE_FINAL . ';' . implode ( ' ' , $ partials ) , ] , ] ) ; $ data = json_decode ( $ response -> getBody ( ) , true ) ; $ checksum = $ data [ 'data' ] [ 'checksum' ] ?? null ; $ statusCode = $ response -> getStatusCode ( ) ; if ( HttpResponse :: HTTP_CREATED !== $ statusCode || ! $ checksum ) { throw new FileException ( 'Unable to create resource.' ) ; } return $ checksum ; }
Concatenate 2 or more partial uploads.

@param string $key
@param mixed  $partials

@return string
Concatenate 2 or more partial uploads .