Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note that only file rules can be used to validate files #7969

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
If you want the file upload to be optional
(not required), do not define this rule.

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, the file validation will not
kenjis marked this conversation as resolved.
Show resolved Hide resolved
work correctly.