How to get file extension from input type file in laravel

Created at 27-Jul-2021 , By samar

How to get file extension from input type file in laravel

Good day, guys. In this post, we’ll look at how to solve the "How to get file extension from input type file in laravel" programming puzzle.

You can get file extension in laravel using HTTP request from input type file in HTML form.
  • Get file extension from $request in laravel

    //Inside controller's method 
    $request->file('media')->extension();
    

    You can simply get the file extension in Laravel using HTTP request. The $request provides the file path and laravel provides lots of methods to get the file properties using this method. 

Back to code snippet queries related laravel

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.