`@Post()
@Roles('USER', 'ADMIN')
@ApiConsumes('multipart/form-data')
@ApiBody({
description: 'Upload file',
type: 'object',
required: true,
})
@UseInterceptors(FileInterceptor('file'))
async uploadFile(
@UploadedFile(
new ParseFilePipe({
validators: [
new FileTypeValidator({ fileType: '.(png|jpeg|jpg)' }),
new MaxFileSizeValidator({ maxSize: 1024 * 1024 * 4 }),
],
}),
)
file: Express.Multer.File,
) {
console.log(file); // You can check the file object in the console
// await this.uploadService.uploadToFile(file);
return { message: 'File uploaded successfully' };
}
how do i resolve this error, this is the way it done in the docs for uploading images for example yet it is not working