trait UploadTrait

Trait UploadTrait

Properties

ApiClient $apiClient Defined in UploadApi class

Methods

buildUploadParams(array $options)

Consolidates the upload parameters.

uploadAsync(string $file, array $options = [])

Uploads an asset to a Cloudinary cloud.

upload(string $file, array $options = [])

Uploads an asset to a Cloudinary cloud.

unsignedUploadAsync(string $file, string $uploadPreset, array $options = [])

Uploads an asset to a Cloudinary cloud.

unsignedUpload(string $file, string $uploadPreset, array $options = [])

Uploads an asset to a Cloudinary cloud.

Details

static array buildUploadParams(array $options)

Consolidates the upload parameters.

Parameters

Name Type Description
$options array The optional parameters. See the upload API documentation.

Return Value

array

See also

https://cloudinary.com/documentation/image_upload_api_reference#upload_method

PromiseInterface uploadAsync(string $file, array $options = [])

Uploads an asset to a Cloudinary cloud.

The asset can be: * a local file path * the actual data (byte array buffer) * the Data URI (Base64 encoded), max ~60 MB (62,910,000 chars) * the remote FTP, HTTP or HTTPS URL address of an existing file * a private storage bucket (S3 or Google Storage) URL of a whitelisted bucket

This is an asynchronous function.

Parameters

Name Type Description
$file string The asset to upload.
$options array The optional parameters. See the upload API documentation.

Return Value

PromiseInterface

Exceptions

ApiError

See also

https://cloudinary.com/documentation/image_upload_api_reference#upload_method

ApiResponse upload(string $file, array $options = [])

Uploads an asset to a Cloudinary cloud.

The asset can be: * a local file path * the actual data (byte array buffer) * the Data URI (Base64 encoded), max ~60 MB (62,910,000 chars) * the remote FTP, HTTP or HTTPS URL address of an existing file * a private storage bucket (S3 or Google Storage) URL of a whitelisted bucket

Parameters

Name Type Description
$file string The asset to upload.
$options array The optional parameters. See the upload API documentation.

Return Value

ApiResponse

Exceptions

ApiError

See also

https://cloudinary.com/documentation/image_upload_api_reference#upload_method

PromiseInterface unsignedUploadAsync(string $file, string $uploadPreset, array $options = [])

Uploads an asset to a Cloudinary cloud.

The upload is not signed so an upload preset is required.

This is an asynchronous function.

Parameters

Name Type Description
$file string The asset to upload.
$uploadPreset string The name of an upload preset.
$options array The optional parameters. See the upload API documentation.

Return Value

PromiseInterface

Exceptions

ApiError

See also

https://cloudinary.com/documentation/image_upload_api_reference#unsigned_upload_syntax

ApiResponse unsignedUpload(string $file, string $uploadPreset, array $options = [])

Uploads an asset to a Cloudinary cloud.

The upload is not signed so an upload preset is required.

Parameters

Name Type Description
$file string The asset to upload.
$uploadPreset string The name of an upload preset.
$options array The optional parameters. See the upload API documentation.

Return Value

ApiResponse

Exceptions

ApiError

See also

https://cloudinary.com/documentation/image_upload_api_reference#unsigned_upload_syntax