在单个输入中对多个上传文件进行编码点火器验证


Codeigniter Validation for Multiple Upload Files in Single Input

我对codeigniter并不陌生,但我是codeigniter上传文件的新手,

我需要使用单个输入字段在编码器点火器中上传多个文件这是我的观点

<form action="" method="POST" name="PostMat" enctype="multipart/form-data">
  <input type="text" name="Title">
  <input type="file" id="MatFiles" multiple="" name="files[]">
  <button type="submit" name="Materials" class="btn">Submit</button>      
</form>

我曾经使用库功能来扩展多重上传和上传验证

多个上传库https://github.com/stvnthomas/CodeIgniter-Multi-Upload

文件验证库https://github.com/jeroen/codeigniter-extended-rules

我使用了这两个库,这两个库函数分别超出了我的预期

这是我的控制器:

$this->form_validation->set_rules('Title', 'title', 'required');
$this->form_validation->set_rules(NOIDEA_WHAT_COMES_ HERE,"files","required|file_allowed_type[png,bmp,jpg]|file_size_max[10]");

我的问题是我需要遍历我上传的多个文件,我需要验证

我在上传文件或获取文件属性时没有任何问题,唯一需要提及的是我需要在"设置规则"field_name的地方提及的内容,

或者是否有任何简单的想法来上传多个带有验证的文件

您可以在CI中尝试此多上传