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);