Initial attachment upload set's now "original" in filename too

- later if the file is moving to filesystem, it has "original" in the filename too.
This commit is contained in:
Martin Filser 2022-04-08 18:59:38 +02:00
parent b8d14abe0c
commit c6212c7d62

View file

@ -24,7 +24,7 @@ Attachments = new FilesCollection({
allowClientCode: true, allowClientCode: true,
namingFunction(opts) { namingFunction(opts) {
const filenameWithoutExtension = opts.name.replace(/(.+)\..+/, "$1"); const filenameWithoutExtension = opts.name.replace(/(.+)\..+/, "$1");
const ret = opts.meta.fileId + "-" + filenameWithoutExtension; const ret = opts.meta.fileId + "-original-" + filenameWithoutExtension;
// remove fileId from meta, it was only stored there to have this information here in the namingFunction function // remove fileId from meta, it was only stored there to have this information here in the namingFunction function
delete opts.meta.fileId; delete opts.meta.fileId;
return ret; return ret;