Zobjoys Jeirmov
Zobjoys Jeirmov

Reputation: 221

How To Get Image Type In Laravel?

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

Answers (1)

cssBlaster21895
cssBlaster21895

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

Related Questions