From a74e7ae5850e584b9498e9cee6b71896e23a3573 Mon Sep 17 00:00:00 2001 From: Esenjin_Asakha Date: Tue, 24 Dec 2024 20:40:48 +0000 Subject: [PATCH] oubli --- list-files.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 list-files.php diff --git a/list-files.php b/list-files.php new file mode 100644 index 0000000..775f565 --- /dev/null +++ b/list-files.php @@ -0,0 +1,36 @@ + $file, + 'size' => filesize($path), + 'date' => date('Y-m-d', filemtime($path)), + 'path' => rawurlencode($file) + ]; + } + } + + return $files; +} + +try { + $files = scanDirectory('.'); + echo json_encode($files); +} catch (Exception $e) { + http_response_code(500); + echo json_encode(['error' => $e->getMessage()]); +} +?>