Save files serverside with filename ObjectID, without filename.

Thanks to g-roliveira, iamabrantes, Floaz, koelle25, scott-dunt, mfilser and xet7 !

Fixes #4416
This commit is contained in:
Lauri Ojansivu 2023-04-17 23:13:06 +03:00
parent f0a6fa68ea
commit 76ac070f9b
2 changed files with 16 additions and 3 deletions

View file

@ -72,7 +72,12 @@ Attachments = new FilesCollection({
filenameWithoutExtension = Math.random().toString(36).slice(2);
fileId = Math.random().toString(36).slice(2);
}
const ret = fileId + "-original-" + filenameWithoutExtension;
// OLD:
//const ret = fileId + "-original-" + filenameWithoutExtension;
// NEW: Save file only with filename of ObjectID, not including filename.
// Fixes https://github.com/wekan/wekan/issues/4416#issuecomment-1510517168
const ret = fileId;
// remove fileId from meta, it was only stored there to have this information here in the namingFunction function
return ret;
},