javascript - Upload image URI to Cloudinary - Stack Overflow

I've done some looking at the Cloudinary API and upload examples for NodeJS, and it looks like the

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 badges
Add a ment  | 

1 Answer 1

Reset to default 7

Cloudinary 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

相关推荐

  • javascript - Upload image URI to Cloudinary - Stack Overflow

    I've done some looking at the Cloudinary API and upload examples for NodeJS, and it looks like the

    6小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信