Difference between #1 and #6 of
Api of Multiple File Uploading in Yii2

Changes

Title unchanged

Api of Multiple File Uploading in Yii2

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags changed

File upload,API,Multiple File,Image upload,yii2,REST API

Content changed

[...]
This is my question I asked on forum and it works for me
https://forum.yiiframework.com/t/multiple-file-uploading-api-in-yii2/130519

Implement this code in model for **Multiple File Uploading**

 
```php [['media'], 'file', 'maxFiles' => 10],public function rules()
 
    {
 
        return [
 
            [['post_id', 'media'], 'required'],
 
            [['post_id'], 'integer'],
 
            [['media'], 'file', 'maxFiles' => 10],//here is my file field
 
            [['created_at'], 'string', 'max' => 25],
 
            [['post_id'], 'exist', 'skipOnError' => true, 'targetClass' => Post::className(), 'targetAttribute' => ['post_id' => 'id']],
 
        ];
 
    }
 
    
``` y
 
 
Y
ou can add extension or any skiponempty method also in model. And this is my controller action where I performed multiple file uploading code.
 
 

```php
public function actionMultiple(){
[...]
}
```

 
 
If any query or question I will respond.
5 0
4 followers
Viewed: 65 397 times
Version: 2.0
Category: Tutorials
Written by: fezzymalek
Last updated by: fezzymalek
Created on: Sep 15, 2020
Last updated: 2 years ago
Update Article

Revisions

View all history