Skip to content

Commit

Permalink
Add note on incompatibility of general rules for file validation use
Browse files Browse the repository at this point in the history
  • Loading branch information
dgvirtual committed Sep 24, 2023
1 parent c4bd34e commit c672b2b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions user_guide_src/source/libraries/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,9 @@ Rule Parameter Description
======================= ========== ============================================= ===================================================
uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]``
match the name of any uploaded files.
Prevents form from validating if file upload
is required.

max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]``
parameter is larger than the second
parameter in kilobytes (kb). Or if the file
Expand All @@ -992,3 +995,7 @@ is_image Yes Fails if the file cannot be determined to be
======================= ========== ============================================= ===================================================

The file validation rules apply for both single and multiple file uploads.

.. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files.
Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string will prevend all rules for the
from file from being processed during validation.

0 comments on commit c672b2b

Please sign in to comment.