From 62f53731cf807562ba885b180e71bb75b3902443 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Jun 2022 14:28:43 +0200 Subject: [PATCH] Fix invalid download filename --- server/controllers/download.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/controllers/download.ts b/server/controllers/download.ts index 43d525f83..a270180c0 100644 --- a/server/controllers/download.ts +++ b/server/controllers/download.ts @@ -86,7 +86,9 @@ async function downloadVideoFile (req: express.Request, res: express.Response) { } await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), path => { - const filename = `${video.name}-${videoFile.resolution}p${videoFile.extname}` + // Express uses basename on filename parameter + const videoName = video.name.replace(/[/\\]/g, '_') + const filename = `${videoName}-${videoFile.resolution}p${videoFile.extname}` return res.download(path, filename) })