If file FILE_ID already exists, it is rewritten. $file is array coming from function postedFiles() $entity must contains fields ID,TYPE identifying to what entity file is assigned. Except this fields, it can contains any optional fields.

Parameters

$entity

associative array with entity data

$file

associative array with file to upload informations. See postedFiles().

Field Documentation

$dirNameFormat = ''

Unused - always "/Y/n/" in this version.

$errors = array()

If upload error occurs, this will contains error messages.

$fileNameFormat = "{PREFIX}{HASH}.{EXT}"

You can use fields: HASH,EXT,ORIGNAME,ORIGNAME_NORMALIZED,FILE_ID or any field from $entity.