// Exemple pour polling du download si nécessaire function checkDownloadStatus(downloadId) { fetch(`/download_status/${downloadId}`) .then(response => response.json()) .then(data => { if(data.status === 'ready') { // Mettre à jour le lien sur la page document.querySelector(`#link-${downloadId}`).innerHTML = `Télécharger`; } else { setTimeout(() => checkDownloadStatus(downloadId), 5000); } }); }