As this plugin is a Behavior, there are some field names you can not use because they are used by the internal CakePHP system. Please do not use these field names:
This is a list of all the available configuration options which can be passed in under each field in your behavior configuration.
pathProcessor
: Returns a ProcessorInterface class name.
Josegonzalez\Upload\File\Path\DefaultProcessor
writer
: Returns a WriterInterface class name.
Josegonzalez\Upload\File\Writer\DefaultWriter
transformer
: Returns a TransformerInterface class name. Can also be a PHP callable.
Josegonzalez\Upload\File\Transformer\DefaultTransformer
path
: A path relative to the filesystem.root
.
'webroot{DS}files{DS}{model}{DS}{field}{DS}'
DIRECTORY_SEPARATOR
{field-value:unique_id}
and the entity
being saved has a value of 4b3403665fea6
for the field
unique_id
, then {field-value:unique_id}
will be
replaced with 4b3403665fea6
. This replacement can be used
multiple times for one or more fields. If the value is not
a string or zero-length, a LogicException will be thrown.date('Y')
date('m')
date('d')
time()
microtime()
fields
: An array of fields to use when uploading files
fields.dir
: (default dir
) Field to use for storing the directoryfields.type
: (default type
) Field to use for storing the filetypefields.size
: (default size
) Field to use for storing the filesizefields.ext
: (default ext
) Field to use for storing the file extensionfilesystem
: An array of configuration info for configuring the writer
If using the DefaultWriter, the following options are available:
filesystem.root
: (default ROOT . DS
) Directory where files should be written to by defaultfilesystem.adapter
: (default Local Flysystem Adapter) A Flysystem-compatible adapter. Can also be a callable that returns an adapter.filesystem.visibility
: (default 'public'
) Sets the related file permissions. Should either be 'public'
or 'private'
.nameCallback
: A callable that can be used by the default pathProcessor to rename a file. Only handles original file naming.
NULL
Table $table
: The table of the current entityEntity $entity
: The entity you want to add/editarray $data
: The upload datastring $field
: The field for which data will be added/editedarray $settings
: UploadBehavior settings for the current fieldkeepFilesOnDelete
: Keep all files when deleting a record.
true
deleteCallback
: A callable that can be used to delete different versions of the file.
NULL
string $path
: Basepath of the file you want to deleteEntity $entity
: The entity you want to deletestring $field
: The field for which data will be removedarray $settings
: UploadBehavior settings for the current fieldrestoreValueOnFailure
: Restores original value of the current field when uploaded file has error
true