0

I am trying to POST a file along with other form data to my laravel API, I have the exact same code as https://stackoverflow.com/a/25264008

But my Laravel API is not receiving any file at all. However, when I test my API with Postman, it works perfectly.

EDIT (this is the partial code in my laravel API):

$file = $request->file('coverphoto');
$extension = $file->getClientOriginalExtension();
$fileName = bin2hex(openssl_random_pseudo_bytes(8)).'.'.$extension;
$file->move('uploads', $fileName);
$myobj->cover = $fileName;
...
$myobj->save();
Community
  • 1
  • 1
Gearbox
  • 336
  • 3
  • 15

0 Answers0