![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/filesystem/ |
Upload File : |
<?php header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST'); header("Access-Control-Allow-Headers: *"); header('Content-Type: application/json; charset=utf-8'); $data = json_decode(file_get_contents('php://input'), true); chdir('..'); if (isset($data["path"])) { $path = $data["path"]; $realPath = ".." . $path; $filesList = scandir($realPath); $fileInfoList = array(); foreach ($filesList as $file) { if ($file[0] == '.') continue; $fileRealPath = $realPath . '/' . $file; $fileViewPath = $path. '/' . $file; $stat = stat($fileRealPath); $info = array(); $info["path"] = $fileViewPath; $mode = $stat["mode"]; $info["isDirectory"] = (($mode >> 12) & 0b111) == 4; $info["mtime"] = $stat["mtime"]; $info["size"] = $stat["size"]; $info["readable"] = is_readable($fileRealPath); $info["writable"] = is_writable($fileRealPath); array_push($fileInfoList, $info); } echo json_encode($fileInfoList); }