diff --git a/src/Elements/Uploader.php b/src/Elements/Uploader.php index 224a6ca..55aaffe 100644 --- a/src/Elements/Uploader.php +++ b/src/Elements/Uploader.php @@ -92,10 +92,15 @@ protected function setValue($mediaCollection) ], ]; } else { - $data[] = [ - 'file' => URL::to($media), - 'name' => $media, - ]; + $file = public_path(trim($media, '/')); + if (file_exists($file)) { + $data[] = [ + 'file' => URL::to($media), + 'name' => basename($media), + 'size' => filesize($file), + 'type' => mime_content_type($file), + ]; + } } }