Api of Multiple File Uploading in Yii2

Comparing #1 with #2

Revision #2 was created by fezzymalek fezzymalek on Sep 15, 2020, 11:51:06 AM.

code

Tags

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

Content

[...]
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']],
 
        ];
 
    }

```
you can add extension or any skiponempty method also
[...]
}
```

 
If any query or question I will repond