Laravel Get File Size from Path Example

Admin   Laravel   1021  2021-03-16 19:20:05

Hii Guys,

In this tutorial,I will learn you how to get file size from path in laravel can simply and easy to get file size in laravel 6.

In bellow example i just give you path of my images folder inside public folder and one image, that give path as argument of size function:

Solution :-



* Show the application dashboard.


* @return \Illuminate\Contracts\Support\Renderable


public function index(Request $request)


$fileSize = \File::size(public_path('image/house2.jpeg'));



Output :-


26849 //size for 26,849 bytes

It will help you......