Answer
This is the solution for this-: In Homecontroller.php
$file = $request->file('admission_import');
$filename = $file->getClientOriginalName();
$response=Http::attach('admission_import',file_get_contents($file->getRealPath()),$filename)->post(''localhost/address_of_api'');
$val=$response->json();
dd($val);
In ApiController.php change this line.
$file=$request->file('filename'); To $file=$request->file('admission_import');
And it is good to go.
0 comments:
Post a Comment
Thanks