Lepozepo / cloudinary

MIT License
94 stars 42 forks source link

Uploading with certain parameters causes Invalid Signature error #35

Open TwiceII opened 9 years ago

TwiceII commented 9 years ago

First of all, thanks for the great package!

Issue I'm facing is: when I include optional parameters (as described in http://cloudinary.com/documentation/upload_images#remote_upload) in my upload, sometimes I get "Invalid Signature xxx. String to sign yyy" error. Some parameters seem to "break" signature, like when I include eager:

Cloudinary.upload(files, {
    folder:"temp",
    format: 'png',
    eager: "c_fill,w_260,h_216"
}, function (err, res) {
...
});

while passing only folder, format parameters works just fine.

Lepozepo commented 9 years ago

You are welcome ^^ I haven't tested for that, I'll see what I can do as soon as I get a chance but I do know that the way I'm signing is probably not the best way to do it. If you are willing to give the package a stab, check Cloudinary's NPM package and try to trace how they are signing the request. They put a lot of bullshit around their code so it might take a bit of time to understand. If you do find out the issue before I get a chance to, please feel free to post a merge request. I'll probably have some time to take a look at the end of the month ><

TwiceII commented 9 years ago

Ok then, I'll inform if I get any insights on that.

a-mummey commented 9 years ago

Just wanted to pipe in on this as I am running into the same error. I was reading this document which says that only certain params need to be signed. From the looks of the code it appears that it is currently signing all parameters. My guess is that if we filter the parameters object and only sign these params: callback, eager, format, public_id, tags, timestamp, transformation, type it could work.

Lepozepo commented 8 years ago

I just repaired this, I'll drop it in the next iteration

sanidhyasharma commented 7 years ago

when i try to upload image with direct call to api it gives me this error plz help Failed to load resource: the server responded with a status of 400 (Bad Request) cldd cloudd