Am trying to save a file in laravel but it endsup being saved as a bin file
$file = $request->file('file');
$name = Carbon::now()->format('Y-m-d')."-".strtotime(Carbon::now()).".".$file->extension();
$stored =$file-> storeAs('temporary', $name); //save the file to temporary
Now the above saves every file as .bin file When i check
$file->extension();
Am getting .bin
Where am i going wrong?
Use the getClientOriginalExtension() method instead of extension():
$file->getClientOriginalExtension();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With