How to get file extension from input type file in laravel

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

Answers 1
  • Get file extension from $request in laravel

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

    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