Difference between #2 and #3 of
How to read HTML5 Multiple File Input from controller?

Revision #3 has been created by Kartik V on May 6, 2014, 6:07:08 AM with the memo:

Elaborate description
« previous (#2) next (#4) »

Changes

Title unchanged

How to read HTML5 Multiple File Input from controller?

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

yii, yii2, file, input, fileinput, widget, upload, html5, multiple

Content changed

[...]
Solution
--------
You must configure the attribute name for HTML5 file input in ARRAY FORMAT for PHP to recognize it as an array of files. So here is how you achieve this as shown below (note the square brackets in the attribute naming):

### For Yii
21.1 ```php echo $form->fieldleInput($model, 'uploadFile[]')->fileInput(['multiple' => true]); ``` ### For Yii 1.12 ```php echo $form->fileInputeld($model, 'uploadFile[]')->fileInput(['multiple' => true]);
```

### For \kartik\widgets\FileInput (Yii 2)

```php
[...]
0 2
40 followers
Viewed: 21 645 times
Version: 2.0
Category: How-tos
Written by: Kartik V
Last updated by: samdark
Created on: May 5, 2014
Last updated: 5 years ago
Update Article

Revisions

View all history