mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
feat: file browser + relink for orphaned files + htmx fix + header cleanup + fix relinked FilePond integration + resolve acces.php conflict markers
This commit is contained in:
@@ -213,12 +213,15 @@ class FilepondHandler
|
||||
die('ID invalide.');
|
||||
}
|
||||
|
||||
error_log($this->logPrefix . ':load ENTRY | db_id=' . $dbId);
|
||||
|
||||
$pdo = Database::getInstance()->getConnection();
|
||||
$stmt = $pdo->prepare('SELECT * FROM thesis_files WHERE id = ?');
|
||||
$stmt->execute([$dbId]);
|
||||
$fileRow = $stmt->fetch();
|
||||
|
||||
if (!$fileRow) {
|
||||
error_log($this->logPrefix . ':load DB NOT FOUND | db_id=' . $dbId);
|
||||
http_response_code(404);
|
||||
die('Fichier introuvable.');
|
||||
}
|
||||
@@ -247,11 +250,13 @@ class FilepondHandler
|
||||
|
||||
$absPath = STORAGE_ROOT . '/' . $filePath;
|
||||
if (!file_exists($absPath) || !is_readable($absPath)) {
|
||||
error_log($this->logPrefix . ':load DISK MISSING | db_id=' . $dbId . ' | absPath=' . $absPath);
|
||||
http_response_code(404);
|
||||
die('Fichier absent du disque.');
|
||||
}
|
||||
|
||||
$fileSize = filesize($absPath);
|
||||
error_log($this->logPrefix . ':load OK | db_id=' . $dbId . ' | path=' . $filePath . ' | mime=' . $mimeType . ' | size=' . $fileSize);
|
||||
header('Content-Type: ' . $mimeType);
|
||||
header('Content-Length: ' . $fileSize);
|
||||
header('Content-Disposition: inline; filename="' . addslashes($fileName) . '"');
|
||||
|
||||
Reference in New Issue
Block a user