Hello , i'me trying to upload a product with an image , I've read that I've to send it in Form-data with 2 fields one with an image file and the second with a json file (maybe its not the way idk so tell me if you know a better way...)
I've successfully intercept them , but i cant validate them separately
I've tried many ways , but nothing work
someone have an idea how to achieve this?
here is my basic controller :
@Post()
@UseInterceptors(FileFieldsInterceptor([
{name:'image',maxCount:1},
{name:'product_description',maxCount:1}
]))
createAndConnect(
@UploadedFile()file: Express.Multer.File) {
return {file}
}
even you have a completely different way to do that tell me , i want to learn