From b73b92de00f4766b7974e05feeffc28abc8152f4 Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Mon, 15 Feb 2021 12:16:08 +0200 Subject: unlink b4 move_uploaded_file --- php/upload.php | 1 + 1 file changed, 1 insertion(+) (limited to 'php/upload.php') diff --git a/php/upload.php b/php/upload.php index a4f816f..def98b3 100644 --- a/php/upload.php +++ b/php/upload.php @@ -41,6 +41,7 @@ if($codename=="filename taken" && $overwrite!=1) http_response_code(409); exit(0); } +unlink("$storage_root/$codename"); move_uploaded_file($file['tmp_name'], "$storage_root/$codename"); http_response_code(200); -- cgit v1.2.3