I am trying to upload the image from postman form-data. I cant get the input
URL: localhost/sampleyii/web-app/web/imageuploads
Method: POST
{"Content-Type":"application/x-www-form-urlencoded"}
Form-data
id : 2
image : test.jpg (type:file)
In my yii coding:
$model = new TblImgUpload();
print_r(Yii::$app->request->post());
$model->load(Yii::$app->request->post(),'');
Response from postman:
Array
(
[------WebKitFormBoundarySHaGMA86OHQV87iT
Content-Disposition:_form-data;_name] => "id"
sdfgdfgdf
------WebKitFormBoundarySHaGMA86OHQV87iT
Content-Disposition: form-data; name="wretr"; filename="test.jpeg"
Content-Type: image/jpeg........
....................
I have tried Content-Type => 'multipart/form-data'. But i cant get the input request.
I want the post request input as form-data (file) as array.
Please help thanks in advance.