X-Git-Url: https://jfr.im/git/uguu.git/blobdiff_plain/8220242883f89283cd6bda196d635ffc3d5ecea2..fb13a2a304582c6abe61f4b3c6551121e34cb67d:/static/php/upload.php diff --git a/static/php/upload.php b/static/php/upload.php index 3a9b0f9..37458a9 100644 --- a/static/php/upload.php +++ b/static/php/upload.php @@ -2,7 +2,7 @@ /* * Uguu * - * @copyright Copyright (c) 2022 Go Johansson (nekunekus) + * @copyright Copyright (c) 2022 Go Johansson (nokonoko) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,13 +24,15 @@ $type = $_GET['output'] ?? 'json'; $response = (new Core\Response($type)); if (isset($_FILES['files'])) { - $uploads = (new Upload())->reFiles($_FILES['files']); + $uploads = Upload::reFiles($_FILES['files']); try { foreach ($uploads as $upload) { - $res[] = (new Upload())->uploadFile($upload); + $res[] = Upload::uploadFile(); + } + if (isset($res)) { + $response->send($res); } - $response->send($res); } catch (Exception $e) { $response->error($e->getCode(), $e->getMessage()); }