From 152772e3ad5233bc3aa314d6c9bc87d8d09b9d37 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Fri, 24 Mar 2023 14:52:26 +0100 Subject: [PATCH] =?UTF-8?q?GIF=20hinzugef=C3=BCgt,=20muss=20getestet=20wer?= =?UTF-8?q?den?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 2 +- upload.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index 2b1776e..6c8b46b 100644 --- a/script.js +++ b/script.js @@ -41,7 +41,7 @@ dropzone.addEventListener('drop', function(e) { this.classList.add('inactive'); file = e.dataTransfer.files[0]; - if( file.type == 'image/png' || file.type == 'image/jpeg' ) { + if( file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif') { upload(e.dataTransfer.files[0]); } }); diff --git a/upload.php b/upload.php index 0867b52..ebf3a9b 100644 --- a/upload.php +++ b/upload.php @@ -14,7 +14,7 @@ if(isset($_FILES['upload'])) { $extension = pathinfo($_FILES['upload']['name'], PATHINFO_EXTENSION); $extension = strtolower($extension); - if($extension == 'jpg' || $extension == 'jpeg' || $extension == 'png') { + if($extension == 'jpg' || $extension == 'jpeg' || $extension == 'png' || $extension == 'gif') { $filename = generate_filename($length) . '.' . $extension; move_uploaded_file($_FILES['upload']['tmp_name'], $datadir . '/' . $filename); echo json_encode(['datadir' => $datadir, 'filename' => $filename]);