How to upload image/file with formgroup value to API?

Viewed 1391

How to upload image and add it to the form when service doing http.post? example product module needs name, price, coverImage. I tried to use many ways that I can get from the internet, forum, etc. But still got no clue about this issue.

I am using model driven form and append it when image is selected and i tried to print out the values of form before send to API. attached image for console.log result:

enter image description here

fyi: I am using API based on PHP Laravel. I tried to get the image from "$request->file('image');"

anybody can help me for this case? thanks.

1 Answers
Related