This is a file upload request from an angular app:
Request:
------WebKitFormBoundaryo5BfYJAUkmJC5BoJ
Content-Disposition: form-data; name="file"; filename="1570306102797.jpg"
Content-Type: image/jpeg
------WebKitFormBoundaryo5BfYJAUkmJC5BoJ--
Header:
POST /api/recipe HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
Host: test.local
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Origin: http://192.168.0.100:8101
Referer: http://192.168.0.100:8101/recipes
Connection: keep-alive
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
Content-Length: 15647436
enctype: multipart/form-data
This is my controller in my Laravel app:
public function store(Request $request)
{
return $request->file('file')->getClientOriginalName();
}
No matter what I try I get a null error as if the request doesn't include the "file" image. Any ideas on how to progress from here?