resource type
how to set resource type =raw in coding using express node js
-1
-
Hi Anas,
When uploading using the NodeJS SDK, you can specify the resource_type in the second parameter (options object). For example:
var cloudinary = require("cloudinary").v2; cloudinary.uploader.upload( "sample.txt", { resource_type: "raw" }, function(error,result){console.log(error,result)} );
To then use the Cloudinary helper methods to get the URL for one of those 'raw' assets you can do:
cloudinary.url("sample.txt", {resource_type: "raw"});
This will build a URL like:
https://res.cloudinary.com/<cloud_name>/raw/upload/sample.txt
Could you please try this and let me know if it works for you?
Best regards,
Aleksandar
0
Post is closed for comments.
Comments
1 comment