<?php
$directory = '../../../alva/conversations/';
$request = json_decode(file_get_contents('php://input'), true);
$fileName = basename($request['fileName'] ?? '');

$filePath = $directory . $fileName;

if (file_exists($filePath)) {
    echo file_get_contents($filePath);
} else {
    echo json_encode(['error' => 'Dosya bulunamadı', 'filePath' => $filePath]);
}
?>