From 0da2f34896ba6282eb0ccea24c673c69937f9e19 Mon Sep 17 00:00:00 2001 From: Jannis Nikou Date: Wed, 24 Apr 2024 13:02:04 -0700 Subject: [PATCH] Update Files.php --- src/Files.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Files.php b/src/Files.php index 76bf5aa..179fd52 100644 --- a/src/Files.php +++ b/src/Files.php @@ -56,6 +56,10 @@ public static function getFileFromBucket(?string $bucket, string $fileId, ?int $ $filePath = $config->get('storage_dir') . '/' . $row->id . '.' . $extension; + if(!file_exists($filePath)) { + $filePath = $config->get('tmp_storage_dir') . '/' . $row->id . '.' . $extension; + } + if(file_exists($filePath)) { header('Content-Type: ' . $row->mime_type); if(Image::isImage($filePath) && (isset($width) || isset($height))) {