From 3f9afe57bcc73bb253e414e1e789d01718bd5f27 Mon Sep 17 00:00:00 2001 From: "Raymond (Kai) Tainaan" <282025710+rtainaan@users.noreply.github.com> Date: Thu, 6 Aug 2026 23:36:07 -0700 Subject: [PATCH] Fix upload crash with repeated file fields The multipart middleware returns an array when a field is repeated, but handleUpload treats every value as one file. Flatten the values before moving them so repeated and unique field names both work. Signed-off-by: Raymond (Kai) Tainaan <282025710+rtainaan@users.noreply.github.com> --- server/controllers/MiscController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/controllers/MiscController.js b/server/controllers/MiscController.js index 591f8ccf2..147fc64fe 100644 --- a/server/controllers/MiscController.js +++ b/server/controllers/MiscController.js @@ -42,7 +42,7 @@ class MiscController { return res.sendStatus(400) } - const files = Object.values(req.files) + const files = Object.values(req.files).flat() let { title, author, series, folder: folderId, library: libraryId } = req.body // Validate request body if (!libraryId || !folderId || typeof libraryId !== 'string' || typeof folderId !== 'string' || !title || typeof title !== 'string') {