I've done some looking at the Cloudinary API and upload examples for NodeJS, and it looks like the server-side uploads use a file path. Meanwhile, the client-side uploads require a frontend input tag. I already have a frontend for users to select and crop a picture to their liking, and this gives me a data URI. I'd like to save this file to Cloudinary without having to use their built in frontend option. Is this possible? This would basically mean that I would be able to call some kind of upload function that can take a URI or file blob.
I've done some looking at the Cloudinary API and upload examples for NodeJS, and it looks like the server-side uploads use a file path. Meanwhile, the client-side uploads require a frontend input tag. I already have a frontend for users to select and crop a picture to their liking, and this gives me a data URI. I'd like to save this file to Cloudinary without having to use their built in frontend option. Is this possible? This would basically mean that I would be able to call some kind of upload function that can take a URI or file blob.
Share Improve this question asked Dec 23, 2014 at 6:47 ritmatterritmatter 3,5184 gold badges26 silver badges43 bronze badges1 Answer
Reset to default 7Cloudinary supports uploading files using a data-URI encoded string too. Please make sure that you send your content as a Data-URI as explained here: http://en.wikipedia/wiki/Data_URI_scheme.
For example, in Node.js:
cloudinary.uploader.upload("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", function(result) {console.log(result)});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745322327a4622497.html
评论列表(0条)