fix(nodejs): use path module to get file basename. Fix Bug 79810

This commit is contained in:
sshakndr
2026-02-06 17:39:09 +07:00
parent 7a1cc7cbdc
commit ada17c99f7

View File

@ -17,6 +17,7 @@
*/
const supportedFormats = require('../public/assets/document-formats/onlyoffice-docs-formats.json'); // eslint-disable-line
const pathModule = require('path');
const fileUtility = {};
@ -39,8 +40,7 @@ fileUtility.getFileNameFromUrl = function getFileNameFromUrl(url, withoutExtensi
fileUtility.getFileName = function getFileName(path, withoutExtension) {
if (!path) return '';
const parts = path.split('/');
const fileName = parts.pop(); // get the file name from the last part of the path
const fileName = pathModule.basename(path); // get the file name from the last part of the path
// get file name without extension
if (withoutExtension) {