Reputation: 221
In PHP Using this thing " $_FILES[ 'uploaded' ][ 'type' ] " , we can get file Type example 'image/jpeg'. So My Question is how to get same output in laravel. Is there any function available in Laravel, which through i can get File type in this 'image/jpeg' Format???
Upvotes: 0
Views: 1258
Reputation: 3710
You can get file data from the request inside your controller.
$file = $request->file('image');
$extension = $file->getClientOriginalExtension();
$mimeType = $file->getMimeType();
Upvotes: 2