diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..71c62bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +o/* diff --git a/index.php b/index.php index 8455a92..7109126 100644 --- a/index.php +++ b/index.php @@ -23,7 +23,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) { $file_tmp = $_FILES['file']['tmp_name']; $error = $_FILES['file']['error']; - // 获取当前年月 + // 获取当前年月,为防止报错,先设置时区 + date_default_timezone_set('Asia/Shanghai'); $year_month = date('Y/m'); $upload_dir = $base_upload_dir . $year_month; @@ -223,7 +224,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) {
- +
@@ -238,7 +239,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) { -
支持格式: JPEG, PNG, GIF, WEBP, BMP, SVG
+
支持格式: JPEG, PNG, GIF, WEBP, AVIF, BMP, SVG
@@ -274,7 +275,7 @@ $(document).ready(function () { clearOutput(); var files = this.files; // 允许的文件类型 - var validFormats = ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/bmp', 'image/svg']; + var validFormats = ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/avif', 'image/bmp', 'image/svg']; var validFiles = Array.from(files).filter(file => validFormats.includes(file.type)); if (validFiles.length === 0) {