Can't upload docx or pptx files on wloudinary using nodejs ?
how can I upload pptx, .docx files on cloudinary bucket, with below code I am able to upload .pdf but not .docx or .pptx
```
I am getting some unsupported file type error
-
Hi Yuvraj,
While much of Cloudinary's functionality is focused on images and videos, we also support uploading, managing, and delivering almost any other file type, which is considered as a
'resource_type=raw'
. Uploading such files directly through the Media Library Console, as theresource_type
parameter is set toauto
, there are cases where certain raw files may not be detected properly (e.g. documents with passwords, pdf with images, etc). Also, when using SDK, the defaults areimage
for server-side uploading andauto
for client-side uploading (see documentation here).For example:
Changing this parameter could be achieved through our SDK integrations (i.e. for developers), and you can learn more about how to work with raw files in our Upload API documentation. For example (i.e. using Node.js):
cloudinary.v2.uploader.upload("sample_document.docx", { resource_type: "raw" }, function(error, result) {console.log(result, error); });
Hope this helps.
Please sign in to leave a comment.
Comments
1 comment