Skip to content

Commit ac585c6

Browse files
authored
Merge pull request #8217 from kenjis/docs-improve-file-validation-rules
docs: make note for "Rules for File Uploads" stand out
2 parents 6fab8e7 + 279e135 commit ac585c6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

user_guide_src/source/libraries/validation.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,13 @@ valid_cc_number Yes Verifies that the credit card number matches
978978
Rules for File Uploads
979979
======================
980980

981-
These validation rules enable you to do the basic checks you might need to verify that uploaded files meet your business needs.
981+
When you validate uploaded files, you must use the rules specifically created for
982+
file validation.
983+
984+
.. important:: Only rules that listed in the table below can be used to validate
985+
files. Therefore, adding any general rules, like ``permit_empty``, to file
986+
validation rules array or string, the file validation will not work correctly.
987+
982988
Since the value of a file upload HTML field doesn't exist, and is stored in the ``$_FILES`` global, the name of the input field will
983989
need to be used twice. Once to specify the field name as you would for any other rule, but again as the first parameter of all
984990
file upload related rules::
@@ -1020,7 +1026,3 @@ is_image Yes Fails if the file cannot be determined to be
10201026
======================= ========== ============================================= ===================================================
10211027

10221028
The file validation rules apply for both single and multiple file uploads.
1023-
1024-
.. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files.
1025-
Therefore, adding any general rules, like ``permit_empty``, to file validation rules array or string, the file validation will not
1026-
work correctly.

0 commit comments

Comments
 (0)