Overworked files API and explorer

This commit is contained in:
2025-06-19 23:14:18 +02:00
parent c42d5a2652
commit de1664469c
15 changed files with 529 additions and 407 deletions

20
api/move.php Normal file
View File

@ -0,0 +1,20 @@
<?php
header('Content-Type: application/json');
require_once __DIR__ . '/../vfs.php';
$data = json_decode(file_get_contents('php://input'), true);
$srcV = $data['src'] ?? '';
$destV = $data['dest'] ?? '';
$srcReal = resolve_path($srcV);
$destReal = resolve_path($destV);
if (!file_exists($srcReal) || !is_dir($destReal)) {
echo json_encode(['success'=>false,'error'=>'Invalid paths']);
exit;
}
$target = $destReal . '/' . basename($srcReal);
$ok = rename($srcReal, $target);
echo json_encode(['success'=>(bool)$ok]);