Functions
Function | Description |
---|---|
delete |
Deletes a file from the active storage service. |
replace |
Stores a file to the current storage service and replaces any existing file with the same file_name. |
saveSettings |
Saves the object's settings back to the database. |
store |
Stores a file to the current storage service and finds a unique filename if collisions exist. |
delete
Deletes a file from the active storage service.
delete($file_location)
Parameter | Description |
---|---|
$file_location |
The URL of the file. |
replace
Stores a file to the current storage service and replaces any existing file with the same file_name.
Return Value: The URL of the stored file.
replace($local_file, $file_name, $relative_path, $remove_original = true, $force_local = false)
Parameter | Description |
---|---|
$local_file |
The absolute path to the local file you wish to store. |
$file_name |
The file name at the storage end point. |
$relative_path |
The path (relative to SITE_ROOT or the bucket / container root) in which to store the file. |
$remove_original |
Whether to delete the local_file or not (defaults to true) |
$force_local |
Forces a local file replacement even if cloud storage is in use by default (defaults to false) |
saveSettings
Saves the object's settings back to the database.
saveSettings()
store
Stores a file to the current storage service and finds a unique filename if collisions exist.
Return Value: The URL of the stored file.
store($local_file, $file_name, $relative_path, $remove_original = true, $prefixes = [], $sanitize_file_name = true)
Parameter | Description |
---|---|
$local_file |
The absolute path to the local file you wish to store. |
$file_name |
The desired file name at the storage end point. |
$relative_path |
The path (relative to SITE_ROOT or the bucket / container root) in which to store the file. |
$remove_original |
Whether to delete the local_file or not. |
$prefixes |
A list of file prefixes that also need to be accounted for when checking file name availability. |
$sanitize_file_name |
Whether to sanitize a file name (defaults to true) |