IMediaUploader
in
Interface for media upload services.
Defines the contract for uploading and managing media files.
Table of Contents
Methods
- delete() : bool
- Delete a file by its public ID
- upload() : array<string|int, mixed>
- Upload a file from local filesystem
- uploadFromUrl() : array<string|int, mixed>
- Upload a file from URL
Methods
delete()
Delete a file by its public ID
public
delete(string $publicId) : bool
Parameters
- $publicId : string
-
The public ID of the file to delete
Tags
Return values
bool —True if deletion was successful
upload()
Upload a file from local filesystem
public
upload(string $filePath[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
- $filePath : string
-
Path to the file to upload
- $options : array<string|int, mixed> = []
-
Upload options (folder, transformation, etc.)
Tags
Return values
array<string|int, mixed> —Upload result with keys: url, public_id, width, height, format
uploadFromUrl()
Upload a file from URL
public
uploadFromUrl(string $url[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
- $url : string
-
URL of the file to upload
- $options : array<string|int, mixed> = []
-
Upload options (folder, transformation, etc.)
Tags
Return values
array<string|int, mixed> —Upload result with keys: url, public_id, width, height, format