diff --git a/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts b/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts index 55a5513543..c423ac17e2 100644 --- a/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts +++ b/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts @@ -47,7 +47,7 @@ export class AttachmentsController { AnyFilesInterceptor({ storage: multer.diskStorage({}), limits: { - fileSize: NC_ATTACHMENT_FIELD_SIZE, + fieldSize: NC_ATTACHMENT_FIELD_SIZE, }, }), ) diff --git a/packages/nocodb-nest/src/modules/public-datas/public-datas.controller.ts b/packages/nocodb-nest/src/modules/public-datas/public-datas.controller.ts index 201f7bf964..792266c05b 100644 --- a/packages/nocodb-nest/src/modules/public-datas/public-datas.controller.ts +++ b/packages/nocodb-nest/src/modules/public-datas/public-datas.controller.ts @@ -2,12 +2,9 @@ import { Controller, Get, HttpCode, - MaxFileSizeValidator, Param, - ParseFilePipe, Post, Request, - UploadedFiles, UseInterceptors, } from '@nestjs/common'; import { AnyFilesInterceptor } from '@nestjs/platform-express'; @@ -49,19 +46,25 @@ export class PublicDatasController { } @Post('/api/v1/db/public/shared-view/:sharedViewUuid/rows') - @UseInterceptors(AnyFilesInterceptor()) + @HttpCode(200) + @UseInterceptors( + AnyFilesInterceptor({ + storage: multer.diskStorage({}), + limits: { + fieldSize: NC_ATTACHMENT_FIELD_SIZE, + }, + }), + ) async dataInsert( @Request() req, @Param('sharedViewUuid') sharedViewUuid: string, - @UploadedFiles() files: Express.Multer.File[], ) { const insertResult = await this.publicDatasService.dataInsert({ sharedViewUuid: sharedViewUuid, password: req.headers?.['xc-password'] as string, body: req.body?.data, siteUrl: (req as any).ncSiteUrl, - // enriched by multer - files, + files: req.files, }); return insertResult;