Browse Source

fix: s3 attachment path

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/6615/head
mertmit 1 year ago
parent
commit
d74b9a46c1
  1. 5
      packages/nocodb/src/db/BaseModelSqlv2.ts
  2. 4
      packages/nocodb/src/services/attachments.service.ts

5
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -4073,8 +4073,9 @@ class BaseModelSqlv2 {
); );
} else if (attachment?.url) { } else if (attachment?.url) {
if (attachment.url.includes('.amazonaws.com/')) { if (attachment.url.includes('.amazonaws.com/')) {
const relativePath = const relativePath = decodeURI(
attachment.url.split('.amazonaws.com/')[1]; attachment.url.split('.amazonaws.com/')[1],
);
promises.push( promises.push(
PresignedUrl.getSignedUrl({ PresignedUrl.getSignedUrl({
path: relativePath, path: relativePath,

4
packages/nocodb/src/services/attachments.service.ts

@ -67,7 +67,9 @@ export class AttachmentsService {
); );
} else { } else {
if (attachment.url.includes('.amazonaws.com/')) { if (attachment.url.includes('.amazonaws.com/')) {
const relativePath = attachment.url.split('.amazonaws.com/')[1]; const relativePath = decodeURI(
attachment.url.split('.amazonaws.com/')[1],
);
promises.push( promises.push(
PresignedUrl.getSignedUrl({ PresignedUrl.getSignedUrl({
path: relativePath, path: relativePath,

Loading…
Cancel
Save