Skip to content

How to retrieve a part of an object by defining a range? #346

@thomasfaure

Description

@thomasfaure

I have implemented the php-opencloud/openstack library, and I use it to retrieve objects (object_store/v1).

I use the retrieve function that allows me to retrieve the content of an object,

but how to retrieve a part of an object using "range" defined in the request header with this library?

It seems possible, see the Api.php extract :

public function getObject(): array
    {
        return [
            'method' => 'GET',
            'path'   => '{containerName}/{+name}',
            'params' => [
                'containerName'     => $this->params->containerName(),
                'name'              => $this->params->objectName(),
                'range'             => $this->params->range(),
                'ifMatch'           => $this->params->ifMatch(),
                'ifNoneMatch'       => $this->params->ifNoneMatch(),
                'ifModifiedSince'   => $this->params->ifModifiedSince(),
                'ifUnmodifiedSince' => $this->params->ifUnmodifiedSince(),
            ],
        ];
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions