SilverStripe\Assets\Storage\AssetContainer::setFromLocalFile
Assign a local file to the backend.
Signature
public function setFromLocalFile(string
$path,
[string
$filename = NULL,
[string
$hash = NULL,
[string
$variant = NULL,
[array
$config = ]]]] )
Parameters
$path
—
string
- Absolute filesystem path to file
$filename
—
string
- Optional path to ask the backend to name as.
Will default to the filename of the $path, excluding directories.
$hash
—
string
- Hash of original file, if storing a variant.
$variant
—
string
- Name of variant, if storing a variant.
$config
—
array
- Write options. {@see AssetStore}
Returns
- array
- Tuple associative array (Filename, Hash, Variant) Unless storing a variant, the hash
will be calculated from the local file content.