i am trying to upload docx file to cloudinary with multer-storage-cloudinary.
here is the code i use
const storage = new CloudinaryStorage({
cloudinary,
params: async (req, file) => ({
folder: 'client-documents',
resource_type: 'raw',
allowed_formats: ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx'],
public_id: `${Date.now()}`
})
});
const upload = multer({
storage,
limits: { fileSize: 10 * 1024 * 1024 } // 10 MB limit
});
but when try with postman i get error
{
"status": "error",
"error": {
"message": "An unknown file format not allowed",
"name": "Error",
"http_code": 400,
"storageErrors": [],
"statusCode": 500,
"status": "error"
},
"message": "An unknown file format not allowed"
}
and see below my preset:
preset screenshot
what should i do? thanks