SDK for PHP 3.x

PostObjectV4
in package
Uses SignatureTrait

Encapsulates the logic for getting the data for an S3 object POST upload form

Tags
link
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html
link
http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html

Table of Contents

Methods

__construct()  : mixed
Constructs the PostObject.
getBucket()  : string
Gets the bucket name.
getClient()  : S3ClientInterface
Gets the S3 client.
getFormAttributes()  : array<string|int, mixed>
Gets the form attributes as an array.
getFormInputs()  : array<string|int, mixed>
Gets the form inputs as an array.
setFormAttribute()  : mixed
Set a form attribute.
setFormInput()  : mixed
Set a form input.

Methods

__construct()

Constructs the PostObject.

public __construct(S3ClientInterface $client, string $bucket, array<string|int, mixed> $formInputs[, array<string|int, mixed> $options = [] ][, mixed $expiration = '+1 hours' ]) : mixed

The options array accepts the following keys:

Parameters
$client : S3ClientInterface

Client used with the POST object

$bucket : string

Bucket to use

$formInputs : array<string|int, mixed>

Associative array of form input fields.

$options : array<string|int, mixed> = []

Policy condition options

$expiration : mixed = '+1 hours'

Upload expiration time value. By default: 1 hour valid period.

Tags
link
http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html

getBucket()

Gets the bucket name.

public getBucket() : string
Return values
string

getFormAttributes()

Gets the form attributes as an array.

public getFormAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFormInputs()

Gets the form inputs as an array.

public getFormInputs() : array<string|int, mixed>
Return values
array<string|int, mixed>

setFormAttribute()

Set a form attribute.

public setFormAttribute(string $attribute, string $value) : mixed
Parameters
$attribute : string

Form attribute to set.

$value : string

Value to set.

setFormInput()

Set a form input.

public setFormInput(string $field, string $value) : mixed
Parameters
$field : string

Field name to set

$value : string

Value to set.

On this page