Hello,
I'm trying to upload a form with form-data. I have text, editor & file fields.
The idea would be you can attach a coverImage in the file field and the editor field can have images too. The issue I have the limit of the content field (editor field). Seems like 1MB, how can I increase this field?
@ApiParam({ name: 'id', type: 'string' })
@ApiBody({ type: UpdateAccommodationDto })
@ApiConsumes('multipart/form-data')
@UseInterceptors(FileInterceptor('file'))
async updateAccommodation(
@Param('id') id: string,
@Body() accommodation: UpdateAccommodationDto,
@UploadedFile() file: Express.Multer.File,
) {
console.log('Received content size:', accommodation.content?.length);
return await this.accommodationService.updateAccommodation(
id,
accommodation,
file,
);
}```
export class UpdateAccommodationDto {
@ApiProperty({
required: false,
description: 'Content of the accommodation',
maxLength: 10485760,
})
@IsOptional()
@MaxFileSize(1e6)
content?: any;
@ApiProperty()
@IsOptional()
@IsString()
title?: string;
@ApiProperty({ type: Boolean })
@IsOptional()
@IsBoolean()
@Transform(({ value }) => value === 'true')
isActive?: boolean;
}
Error:
{
message: 'Field value too long',
error: 'Bad Request',
statusCode: 400
}
The frontend call is from a Nextjs server action. Everythings works when the content field don't is below 1MB