Files
FileRise/getFolderList.php
2025-03-03 01:13:52 -05:00

19 lines
405 B
PHP

<?php
require 'config.php';
header('Content-Type: application/json');
$folderList = [];
$dir = rtrim(UPLOAD_DIR, '/\\');
if (is_dir($dir)) {
foreach (scandir($dir) as $item) {
if ($item === '.' || $item === '..') continue;
$path = $dir . DIRECTORY_SEPARATOR . $item;
if (is_dir($path)) {
$folderList[] = $item;
}
}
}
echo json_encode($folderList);
?>