Storage/src/StorageObject.php
public function beginSignedUploadSession(array $options = [])
    {
        $expires = new \DateTimeImmutable('+1 minute');
        $startUri = $this->signedUploadUrl($expires, $options);

        $uploaderOptions = $this->pluckArray([
            'contentType',
            'origin'
        ], $options);

        if (!isset($uploaderOptions['origin'])) {
            $uploaderOptions['origin'] = '*';
        }

        $uploader = new SignedUrlUploader($this->connection->requestWrapper(), '', $startUri, $uploaderOptions);

        return $uploader->getResumeUri();
    }
public function beginSignedUploadSession(array $options = [])
    {
        $expires = new \DateTimeImmutable('+1 minute');
        $startUri = $this->signedUploadUrl($expires, $options);

        $uploaderOptions = $this->pluckArray([
            'contentType',
            'origin'
        ], $options);

        if (!isset($uploaderOptions['origin'])) {
            $uploaderOptions['origin'] = '*';
        }

        $uploader = new SignedUrlUploader($this->connection->requestWrapper(), '', $startUri, $uploaderOptions);

        return $uploader->getResumeUri();
    }
public function beginSignedUploadSession ( array $ options = [ ] ) { $ expires = new \ DateTimeImmutable ( '+1 minute' ) ; $ startUri = $ this -> signedUploadUrl ( $ expires , $ options ) ; $ uploaderOptions = $ this -> pluckArray ( [ 'contentType' , 'origin' ] , $ options ) ; if ( ! isset ( $ uploaderOptions [ 'origin' ] ) ) { $ uploaderOptions [ 'origin' ] = '*' ; } $ uploader = new SignedUrlUploader ( $ this -> connection -> requestWrapper ( ) , '' , $ startUri , $ uploaderOptions ) ; return $ uploader -> getResumeUri ( ) ; }
Create a signed URL upload session.

The returned URL differs from the return value of
{@see Google\Cloud\Storage\StorageObject::signedUploadUrl()} in that it
is ready to accept upload data immediately via an HTTP PUT request.

Because an upload session is created by the client, the expiration date
is not configurable. The URL generated by this method is valid for one
week.

Example:
```
$url = $object->beginSignedUploadSession();
```

```
// Use Signed URLs v4
$url = $object->beginSignedUploadSession([
'version' => 'v4'
]);
```

@see https://cloud.google.com/storage/docs/xml-api/resumable-upload#practices Resumable Upload Best Practices

@param array $options {
Configuration Options.

@type string $contentMd5 The MD5 digest value in base64. If you
provide this, the client must provide this HTTP header with
this same value in its request. If provided, take care to
always provide this value as a base64 encoded string.
@type string $contentType If you provide this value, the client must
provide this HTTP header set to the same value.
@type bool $forceOpenssl If true, OpenSSL will be used regardless of
whether phpseclib is available. **Defaults to** `false`.
@type array $headers If additional headers are provided, the server
will check to make sure that the client provides matching
values. Provide headers as a key/value array, where the key is
the header name, and the value is an array of header values.
Headers with multiple  values may provide values as a simple
array, or a comma-separated string. For a reference of allowed
headers, see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers).
Header values will be trimmed of leading and trailing spaces,
multiple spaces within values will be collapsed to a single
space, and line breaks will be replaced by an empty string.
V2 Signed URLs may not provide `x-goog-encryption-key` or
`x-goog-encryption-key-sha256` headers.
@type array $keyFile Keyfile data to use in place of the keyfile with
which the client was constructed. If `$options.keyFilePath` is
set, this option is ignored.
@type string $keyFilePath A path to a valid Keyfile to use in place
of the keyfile with which the client was constructed.
@type string $origin Value of CORS header
"Access-Control-Allow-Origin". **Defaults to** `"*"`.
@type string|array $scopes One or more authentication scopes to be
used with a key file. This option is ignored unless
`$options.keyFile` or `$options.keyFilePath` is set.
@type array $queryParams Additional query parameters to be included
as part of the signed URL query string. For allowed values,
see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers#query).
@type string $version One of "v2" or "v4". **Defaults to** `"v2"`.
}
@return string
Create a signed URL upload session .