public function upload(ApiClientContract $api, $path, $body, array $params = [], $verifyChecksum = true)
    {
        $response = $api->request('PUT', $path, [
            'headers' => $this->convertUploadParamsToHeaders($body, $params, $verifyChecksum),
            'body' => $body,
            'query' => $this->extractQueryParameters($params),
        ]);

        if ($response->getStatusCode() !== 201) {
            throw new UploadFailedException('Unable to upload file.', $response->getStatusCode());
        }

        return $response->getHeaderLine('ETag');
    }
public function upload(ApiClientContract $api, $path, $body, array $params = [], $verifyChecksum = true)
    {
        $response = $api->request('PUT', $path, [
            'headers' => $this->convertUploadParamsToHeaders($body, $params, $verifyChecksum),
            'body' => $body,
            'query' => $this->extractQueryParameters($params),
        ]);

        if ($response->getStatusCode() !== 201) {
            throw new UploadFailedException('Unable to upload file.', $response->getStatusCode());
        }

        return $response->getHeaderLine('ETag');
    }
public function upload ( ApiClientContract $ api , $ path , $ body , array $ params = [ ] , $ verifyChecksum = true ) { $ response = $ api -> request ( 'PUT' , $ path , [ 'headers' => $ this -> convertUploadParamsToHeaders ( $ body , $ params , $ verifyChecksum ) , 'body' => $ body , 'query' => $ this -> extractQueryParameters ( $ params ) , ] ) ; if ( $ response -> getStatusCode ( ) !== 201 ) { throw new UploadFailedException ( 'Unable to upload file.' , $ response -> getStatusCode ( ) ) ; } return $ response -> getHeaderLine ( 'ETag' ) ; }
Upload file from string or stream resource.

@param \ArgentCrusade\Selectel\CloudStorage\Contracts\Api\ApiClientContract $api
@param string                                                               $path           Remote path.
@param string|resource                                                      $body           File contents.
@param array                                                                $params         = [] Upload params.
@param bool                                                                 $verifyChecksum = true

@throws \ArgentCrusade\Selectel\CloudStorage\Exceptions\UploadFailedException

@return string
Upload file from string or stream resource .