我有这个数组想要获取图像的大小:
$main_image = $product->images()->where('main_image', 1)->first();
if($main_image){
$url = asset('uploads/products/'. $main_image['image']);
$image[] = [
"name" => $main_image->image,
"type" => FileUploader::mime_content_type($main_image->image_path),
"size" => filesize($url),
"file" => $main_image->image_path,
"local" => $main_image->image_path,
];
}
我得到这个错误:
filesize(): stat failed for http://myapp.test/uploads/products/83QhiRFarGpV.jpeg
甚至我的图像也存在于文件夹中!
我尝试了这个中的所有选项,但仍然有相同的错误!
哈士奇WWW