File Upload Yii2 Rest Api

[Solved] File Upload Yii2 Rest Api | Php Frameworks Yii - Code Explorer | yomemimo.com
Question : file upload yii2 rest api

Answered by : panicky-panther-bbh258tbe9vk

 $uploads = UploadedFile::getInstancesByName("upfile"); if (empty($uploads)){ return "Must upload at least 1 file in upfile form-data POST"; } // $uploads now contains 1 or more UploadedFile instances $savedfiles = []; foreach ($uploads as $file){ $path = //Generate your save file path here; $file->saveAs($path); //Your uploaded file is saved, you can process it further from here }

Source : https://stackoverflow.com/questions/37185717/file-upload-in-rest-api-yii2 | Last Update : Fri, 30 Apr 21

Answers related to file upload yii2 rest api

Code Explorer Popular Question For Php Frameworks Yii