This is my field in DTO
@IsNotEmpty({ message: 'Nội dung này không được để trống!' })
@IsString()
@MinLength(0, { message: 'Độ dài bài viết không hợp lệ!' })
content: string;
I have not set a maximum limit for this field, but when transmitting a large string of 3184658 characters an error occurred
"statusCode": 400,
"message": "Field value too long",
"error": "Bad Request"
If the error is due to DTO, the error code will usually be 422 (not 400). I tried reconfiguring my middleware but it's not work
app.use(bodyParser.json({ limit: '10mb' }));
app.use(bodyParser.urlencoded({ limit: '10mb', extended: true }));
Because Form-Data. Is there any way to remove the limit for formdata?
you need to increase the field data limit in multer module: