Lepozepo / cloudinary

MIT License
94 stars 42 forks source link

uploading base64 #19

Open ghost opened 9 years ago

ghost commented 9 years ago

How can you upload a base64?

http://support.cloudinary.com/hc/en-us/articles/202519992-How-to-upload-a-Base64-DataURI-string-of-an-image-directly-from-the-browser-

Lepozepo commented 9 years ago

You can't, I need to upgrade this package to work the way my S3 package is working, I can probably get base64 working then. Hope to make changes within the coming couple of weeks.

Lepozepo commented 9 years ago

This doesn't look too difficult to do now, I'll put it as a feature request for the next patch.

Lepozepo commented 9 years ago

Check out the new update! It's more efficient and flexible ^_^.

Secretmapper commented 9 years ago

@Lepozepo Examples please? ^_^

Secretmapper commented 9 years ago

To anyone who wants an example:

Cloudinary._upload_file("base64", {}, callback);

Basically, Cloudinary.upload reads image files as base64, and passes it to _upload_file, so you can just directly pass the base64 data to internal method and it will work.

Lepozepo commented 9 years ago

Wow, that works? That's pretty sweet, I didn't even know, lol. I only just had a look at their docs again though and it makes sense that it would since they accept the incoming signal as a base64 string. I'll patch up the code when I get a chance to make it a little more obvious and I'll add it to the docs. Thanks for the insight @Secretmapper !

atulmy commented 8 years ago

Thanks, this helped!

1ns1d3r commented 8 years ago

@Lepozepo this enhancement don't works anymore for me in version 4.1.6, but when I just downgraded to version 4.1.3 it works fine again, do you know why?

I got the following error in browser's console:

Exception in delivering result of invoking 'c.sign': TypeError: Cannot set property '_id' of undefined