@@ -212,6 +212,21 @@ maxSizeMessage
212212
213213The message displayed if the file is larger than the `maxSize `_ option.
214214
215+ You can use the following parameters in this message:
216+ +------------------+------------------------------------------------+
217+ | Parameter | Description |
218+ +==================+================================================+
219+ | ``{{ size }} `` | File size of the file |
220+ +------------------+------------------------------------------------+
221+ | ``{{ limit }} `` | Maximum file size allowed |
222+ +------------------+------------------------------------------------+
223+ | ``{{ suffix }} `` | Suffix for the used file size unit (see above) |
224+ +------------------+------------------------------------------------+
225+ | ``{{ file }} `` | Full file path |
226+ +------------------+------------------------------------------------+
227+ | ``{{ name }} `` | Base file name |
228+ +------------------+------------------------------------------------+
229+
215230mimeTypesMessage
216231~~~~~~~~~~~~~~~~
217232
@@ -220,6 +235,19 @@ mimeTypesMessage
220235The message displayed if the mime type of the file is not a valid mime type
221236per the `mimeTypes `_ option.
222237
238+ You can use the following parameters in this message:
239+ +-----------------+----------------------------------------+
240+ | Parameter | Description |
241+ +=================+========================================+
242+ | ``{{ type }} `` | The (disallowed) mime type of the file |
243+ +-----------------+----------------------------------------+
244+ | ``{{ types }} `` | The list of allowed mime types |
245+ +-----------------+----------------------------------------+
246+ | ``{{ file }} `` | Full file path |
247+ +-----------------+----------------------------------------+
248+ | ``{{ name }} `` | Base file name |
249+ +-----------------+----------------------------------------+
250+
223251disallowEmptyMessage
224252~~~~~~~~~~~~~~~~~~~~
225253
@@ -228,6 +256,15 @@ disallowEmptyMessage
228256This constraint checks if the uploaded file is empty (i.e. 0 bytes). If it is,
229257this message is displayed.
230258
259+ You can use the following parameters in this message:
260+ +----------------+----------------+
261+ | Parameter | Description |
262+ +================+================+
263+ | ``{{ file }} `` | Full file path |
264+ +----------------+----------------+
265+ | ``{{ name }} `` | Base file name |
266+ +----------------+----------------+
267+
231268notFoundMessage
232269~~~~~~~~~~~~~~~
233270
@@ -237,6 +274,13 @@ The message displayed if no file can be found at the given path. This error
237274is only likely if the underlying value is a string path, as a ``File `` object
238275cannot be constructed with an invalid file path.
239276
277+ You can use the following parameters in this message:
278+ +----------------+----------------+
279+ | Parameter | Description |
280+ +================+================+
281+ | ``{{ file }} `` | Full file path |
282+ +----------------+----------------+
283+
240284notReadableMessage
241285~~~~~~~~~~~~~~~~~~
242286
@@ -245,6 +289,13 @@ notReadableMessage
245289The message displayed if the file exists, but the PHP ``is_readable() `` function
246290fails when passed the path to the file.
247291
292+ You can use the following parameters in this message:
293+ +----------------+----------------+
294+ | Parameter | Description |
295+ +================+================+
296+ | ``{{ file }} `` | Full file path |
297+ +----------------+----------------+
298+
248299uploadIniSizeErrorMessage
249300~~~~~~~~~~~~~~~~~~~~~~~~~
250301
@@ -253,6 +304,15 @@ uploadIniSizeErrorMessage
253304The message that is displayed if the uploaded file is larger than the ``upload_max_filesize ``
254305``php.ini `` setting.
255306
307+ You can use the following parameters in this message:
308+ +------------------+------------------------------------------------+
309+ | Parameter | Description |
310+ +==================+================================================+
311+ | ``{{ limit }} `` | Maximum file size allowed |
312+ +------------------+------------------------------------------------+
313+ | ``{{ suffix }} `` | Suffix for the used file size unit (see above) |
314+ +------------------+------------------------------------------------+
315+
256316uploadFormSizeErrorMessage
257317~~~~~~~~~~~~~~~~~~~~~~~~~~
258318
@@ -261,14 +321,60 @@ uploadFormSizeErrorMessage
261321The message that is displayed if the uploaded file is larger than allowed
262322by the HTML file input field.
263323
324+ This message has no parameters.
325+
326+ uploadPartialErrorMessage
327+ ~~~~~~~~~~~~~~~~~~~~~~~~~
328+ **type **: ``string `` **default **: ``The file was only partially uploaded. ``
329+
330+ The message that is displayed if the uploaded file is only partially uploaded.
331+
332+ This message has no parameters.
333+
334+ uploadNoFileErrorMessage
335+ ~~~~~~~~~~~~~~~~~~~~~~~~
336+ **type **: ``string `` **default **: ``No file was uploaded. ``
337+
338+ The message that is displayed if no file was uploaded.
339+
340+ This message has no parameters.
341+
342+ uploadNoTmpDirErrorMessage
343+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
344+ **type **: ``string `` **default **: ``No temporary folder was configured in php.ini. ``
345+
346+ The message that is displayed if the php.ini setting ``upload_tmp_dir `` is
347+ missing.
348+
349+ This message has no parameters.
350+
351+ uploadCantWriteErrorMessage
352+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
353+ **type **: ``string `` **default **: ``Cannot write temporary file to disk. ``
354+
355+ The message that is displayed if the uploaded file can't be stored in the
356+ temporary folder.
357+
358+ This message has no parameters.
359+
360+ uploadExtensionErrorMessage
361+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
362+ **type **: ``string `` **default **: ``A PHP extension caused the upload to fail. ``
363+
364+ The message that is displayed if a PHP extension caused the file upload to
365+ fail.
366+
367+ This message has no parameters.
368+
264369uploadErrorMessage
265370~~~~~~~~~~~~~~~~~~
266371
267372**type **: ``string `` **default **: ``The file could not be uploaded. ``
268373
269374The message that is displayed if the uploaded file could not be uploaded
270- for some unknown reason, such as the file upload failed or it couldn't be
271- written to disk.
375+ for some unknown reason.
376+
377+ This message has no parameters.
272378
273379.. include :: /reference/constraints/_payload-option.rst.inc
274380
0 commit comments