8.4.2: how to validate multiple uploading files
Permalink
I have a number of Select File widgets on a page:
I get the files array with:
And I need to validate each of them. I can't figure out how I get each of them from the array. If I had only one file, I'd get it as:
How do I get them in a loop for validation?
echo $form->file('file[]', ['accept' => ".jpg, .jpeg, .png"]);
I get the files array with:
$files = $this->request->files;
And I need to validate each of them. I can't figure out how I get each of them from the array. If I had only one file, I'd get it as:
$f = $files->get('file');
How do I get them in a loop for validation?