如何验证文件数 [英] How to validation number of files

查看:72
本文介绍了如何验证文件数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何验证文件数量. 我发现了很多方法,并且阅读了很多主题.但是我找不到这个结果. 我只找到验证文件的大小.

How to validation number of files. I find many way and read alot of topic. But i can't found this result. I found only validation files size.

'files' => 'size:2560|max:2560'

所有这些仅文件大小. 我怎么知道文件数量.

All of this only files size. How can I know number of files.

推荐答案

如果文件是数组,则 max 检查数组长度.

if your files is an array max checks array length.

'files' => 'max:5' //maximum number of files: 5

'files.*' => 'max:5' //maximum size of each file: 5kb

这篇关于如何验证文件数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆