get image name and extension laravel

49

$file = $request->file('filename')->getClientOriginalName();

$filename = pathinfo($file, PATHINFO_FILENAME);
$extension = pathinfo($file, PATHINFO_EXTENSION);

// Please do comment if you have a better approach
// We all here to find shorter and faster way to get things done
// Thank you

Comments

Submit
0 Comments