diff --git a/packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts b/packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts index 8513c7454a..08220e4c81 100644 --- a/packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts @@ -133,7 +133,7 @@ export class ThumbnailGeneratorProcessor { relativePath = decodeURI(new URL(attachment.url).pathname); signedUrl = await PresignedUrl.getSignedUrl({ - pathOrUrl: relativePath, + pathOrUrl: attachment.url, preview: false, filename: attachment.title, mimetype: attachment.mimetype, @@ -143,9 +143,7 @@ export class ThumbnailGeneratorProcessor { .data as Buffer; } - if (relativePath.startsWith('/nc/uploads/')) { - relativePath = relativePath.replace('/nc/uploads/', ''); - } + relativePath = relativePath.replace(/^.*?(?=\/noco)/, ''); return { file, relativePath }; }