Laravel Get File Size from Path Example
Dec 20, 2019
Hii Guys,
In this tutorial,I will learn you how to get file size from path in laravel 6.you 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'));
dd($fileSize);
}
Output :-
26849 //size for 26,849 bytes
It will help you......
- How to Notifications With database Driver in Laravel 11?
- How to Send Email Via Notification in Laravel 11?
- How to Install and Configure Laravel 11 Debugbar?
- How to Like Dislike System in Laravel 11?
- How to Paginate a Model with Relationship in Laravel 11?
- Laravel 11 Upload Files to Amazon S3 Example
- Laravel 11 Send WhatsApp Messages Example
- Laravel 11 Rest API Authentication Using JWT Tutorial