From 1a61994c618a581f2f667ba2921f7e8abc214ca1 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+SamTV12345@users.noreply.github.com> Date: Thu, 18 Jan 2024 22:43:21 +0100 Subject: [PATCH] Fixed determining file extension. (#6111) --- src/node/handler/ImportHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 6caf7ba93..35ceddfdd 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -114,7 +114,7 @@ const doImport = async (req, res, padId, authorId) => { // ensure this is a file ending we know, else we change the file ending to .txt // this allows us to accept source code files like .c or .java - const fileEnding = path.extname(srcFile).toLowerCase(); + const fileEnding = path.extname(files.file[0].originalFilename).toLowerCase(); const knownFileEndings = ['.txt', '.doc', '.docx', '.pdf', '.odt', '.html', '.htm', '.etherpad', '.rtf']; const fileEndingUnknown = (knownFileEndings.indexOf(fileEnding) < 0);