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

Revision #2 has been created by fezzymalek on Sep 15, 2020, 11:51:06 AM with the memo:

« previous (#1) next (#3) »


Title unchanged

Api of Multiple File Uploading in Yii2

Category unchanged


Yii version unchanged


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

Implement this code in model for **Multiple File Uploading**
[['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
1 0
1 follower
Viewed: 6 508 times
Version: 2.0
Category: Tutorials
Written by: fezzymalek
Last updated by: fezzymalek
Created on: Sep 15, 2020
Last updated: 5 months ago
Update Article


View all history