From b7698c4d8500a8cab4e3b664758a0dacc3500319 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 20 Apr 2026 15:48:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E9=A6=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bootstrap/mime_content_type_polyfill.php | 33 ++++++++++++++++++++++++ composer.json | 5 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 bootstrap/mime_content_type_polyfill.php diff --git a/bootstrap/mime_content_type_polyfill.php b/bootstrap/mime_content_type_polyfill.php new file mode 100644 index 0000000..a074ec7 --- /dev/null +++ b/bootstrap/mime_content_type_polyfill.php @@ -0,0 +1,33 @@ + 'image/png', + 'jpg' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'gif' => 'image/gif', + 'webp' => 'image/webp', + 'bmp' => 'image/bmp', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'svg' => 'image/svg+xml', + 'emf' => 'application/octet-stream', + 'wmf' => 'application/x-msmetafile', + 'bin' => 'application/octet-stream', + ]; + + return $map[$ext] ?? 'application/octet-stream'; + } +} diff --git a/composer.json b/composer.json index aab6af3..2c21f9a 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,10 @@ "App\\": "app/", "Database\\Factories\\": "database/factories/", "Database\\Seeders\\": "database/seeders/" - } + }, + "files": [ + "bootstrap/mime_content_type_polyfill.php" + ] }, "autoload-dev": { "psr-4": {