\UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.',
\UPLOAD_ERR_NO_FILE => 'No file was uploaded.',
\UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.',
\UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',
\UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',
];
$errorCode =
$this->error;
$maxFilesize = \UPLOAD_ERR_INI_SIZE ===
$errorCode ? self::
getMaxFilesize() / 1024 : 0;
$message =
$errors[$errorCode] ?? 'The file "%s" was not uploaded due to an unknown error.';
return sprintf($message,
$this->
getClientOriginalName(),
$maxFilesize);
}}