diff --git a/reference/constraints/File.rst b/reference/constraints/File.rst index abf6a68eb5a..93acd81e4a3 100644 --- a/reference/constraints/File.rst +++ b/reference/constraints/File.rst @@ -212,6 +212,21 @@ maxSizeMessage The message displayed if the file is larger than the `maxSize`_ option. +You can use the following parameters in this message: ++------------------+------------------------------------------------+ +| Parameter | Description | ++==================+================================================+ +| ``{{ size }}`` | File size of the file | ++------------------+------------------------------------------------+ +| ``{{ limit }}`` | Maximum file size allowed | ++------------------+------------------------------------------------+ +| ``{{ suffix }}`` | Suffix for the used file size unit (see above) | ++------------------+------------------------------------------------+ +| ``{{ file }}`` | Full file path | ++------------------+------------------------------------------------+ +| ``{{ name }}`` | Base file name | ++------------------+------------------------------------------------+ + mimeTypesMessage ~~~~~~~~~~~~~~~~ @@ -220,6 +235,19 @@ mimeTypesMessage The message displayed if the mime type of the file is not a valid mime type per the `mimeTypes`_ option. +You can use the following parameters in this message: ++-----------------+----------------------------------------+ +| Parameter | Description | ++=================+========================================+ +| ``{{ type }}`` | The (disallowed) mime type of the file | ++-----------------+----------------------------------------+ +| ``{{ types }}`` | The list of allowed mime types | ++-----------------+----------------------------------------+ +| ``{{ file }}`` | Full file path | ++-----------------+----------------------------------------+ +| ``{{ name }}`` | Base file name | ++-----------------+----------------------------------------+ + disallowEmptyMessage ~~~~~~~~~~~~~~~~~~~~ @@ -228,6 +256,15 @@ disallowEmptyMessage This constraint checks if the uploaded file is empty (i.e. 0 bytes). If it is, this message is displayed. +You can use the following parameters in this message: ++----------------+----------------+ +| Parameter | Description | ++================+================+ +| ``{{ file }}`` | Full file path | ++----------------+----------------+ +| ``{{ name }}`` | Base file name | ++----------------+----------------+ + notFoundMessage ~~~~~~~~~~~~~~~ @@ -237,6 +274,13 @@ The message displayed if no file can be found at the given path. This error is only likely if the underlying value is a string path, as a ``File`` object cannot be constructed with an invalid file path. +You can use the following parameters in this message: ++----------------+----------------+ +| Parameter | Description | ++================+================+ +| ``{{ file }}`` | Full file path | ++----------------+----------------+ + notReadableMessage ~~~~~~~~~~~~~~~~~~ @@ -245,6 +289,13 @@ notReadableMessage The message displayed if the file exists, but the PHP ``is_readable()`` function fails when passed the path to the file. +You can use the following parameters in this message: ++----------------+----------------+ +| Parameter | Description | ++================+================+ +| ``{{ file }}`` | Full file path | ++----------------+----------------+ + uploadIniSizeErrorMessage ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -253,6 +304,15 @@ uploadIniSizeErrorMessage The message that is displayed if the uploaded file is larger than the ``upload_max_filesize`` ``php.ini`` setting. +You can use the following parameters in this message: ++------------------+------------------------------------------------+ +| Parameter | Description | ++==================+================================================+ +| ``{{ limit }}`` | Maximum file size allowed | ++------------------+------------------------------------------------+ +| ``{{ suffix }}`` | Suffix for the used file size unit (see above) | ++------------------+------------------------------------------------+ + uploadFormSizeErrorMessage ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -261,14 +321,60 @@ uploadFormSizeErrorMessage The message that is displayed if the uploaded file is larger than allowed by the HTML file input field. +This message has no parameters. + +uploadPartialErrorMessage +~~~~~~~~~~~~~~~~~~~~~~~~~ +**type**: ``string`` **default**: ``The file was only partially uploaded.`` + +The message that is displayed if the uploaded file is only partially uploaded. + +This message has no parameters. + +uploadNoFileErrorMessage +~~~~~~~~~~~~~~~~~~~~~~~~ +**type**: ``string`` **default**: ``No file was uploaded.`` + +The message that is displayed if no file was uploaded. + +This message has no parameters. + +uploadNoTmpDirErrorMessage +~~~~~~~~~~~~~~~~~~~~~~~~~~ +**type**: ``string`` **default**: ``No temporary folder was configured in php.ini.`` + +The message that is displayed if the php.ini setting ``upload_tmp_dir`` is +missing. + +This message has no parameters. + +uploadCantWriteErrorMessage +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +**type**: ``string`` **default**: ``Cannot write temporary file to disk.`` + +The message that is displayed if the uploaded file can't be stored in the +temporary folder. + +This message has no parameters. + +uploadExtensionErrorMessage +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +**type**: ``string`` **default**: ``A PHP extension caused the upload to fail.`` + +The message that is displayed if a PHP extension caused the file upload to +fail. + +This message has no parameters. + uploadErrorMessage ~~~~~~~~~~~~~~~~~~ **type**: ``string`` **default**: ``The file could not be uploaded.`` The message that is displayed if the uploaded file could not be uploaded -for some unknown reason, such as the file upload failed or it couldn't be -written to disk. +for some unknown reason. + +This message has no parameters. .. include:: /reference/constraints/_payload-option.rst.inc