mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-04-05 12:41:27 +00:00
fix: correction du téléchargement du fichier
This commit is contained in:
@ -27,5 +27,13 @@ export const getSecureFileUrl = (filePath) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Décoder le chemin au cas où il est déjà URL-encodé (ex: %20 pour les espaces)
|
||||
// puis ré-encoder proprement pour éviter le double encodage (%2520).
|
||||
try {
|
||||
filePath = decodeURIComponent(filePath);
|
||||
} catch {
|
||||
// Si le décodage échoue, le chemin n'était pas encodé : on le garde tel quel.
|
||||
}
|
||||
|
||||
return `/api/download?path=${encodeURIComponent(filePath)}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user