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()]); +} +?>