<?php
session_start();

$uploadedFiles = [];

if (isset($_SESSION['uploaded_files'])) {
    foreach ($_SESSION['uploaded_files'] as $formId => $fileName) {
        $uploadedFiles[] = [
            'formId' => $formId,
            'fileName' => $fileName
        ];
    }
}

header('Content-Type: application/json');
echo json_encode($uploadedFiles);
?>
