Reputation: 23
$files = $request->file('images'); // return {}
$_FILES['images']; // return {"name":"sample-passport.jpg","type":"image\/jpeg","tmp_name":"D:\\xampp\\tmp\\php4AD9.tmp","error":0,"size":264295}
Upvotes: 1
Views: 1849
Reputation: 5358
Have you tried to remove the Content-Type
header? According to this Github issue, it seems to be a problem.
So, I set up a new Laravel installation to test this out and it's working fine on my side. Of course, there's no authorisation whatsoever but this shouldn't impact the result too much.
routes/api.php
Route::post('/profile/upload_image', function (Request $request) {
dd($request->file('image'));
});
Postman configs
Upvotes: 1
Reputation: 1
Your post input attribute type change file after upload you will get a response.enter image description here
Upvotes: 0