I have created a factory in my project file using fzaninotto/faker like this :
'icon' => $faker->file($sourceDir='/home/gujarat/fakerFile/images', $targetDir='./public/iconLibrary', false),
'title' => $faker->name,
'date' => $faker->numberBetween($min = 1900, $max = 2016),
'size' => $faker->randomFloat($nbMaxDecimals = 10.0, $min = 2.0, $max = 10.0),
'file_type' => 'video/mp4',
'download_url' => $faker->file($sourceDir='/home/gujarat/fakerFile/video', $targetDir='./public/videoLibrary', false),
'category_id' => $randomCategory->id,
I need to get the size of the selected file from $faker->file() as you can see in my field download_url
in MB or KB, and the file extension is .mp4 is it possible to do this?