I can't upload image via curl because error: Invalid Signature

Comments

2 comments

  • Avatar
    Aleksandar Kostadinov

    Hi,

    I've checked the logs on our side and the correct string to sign was indeed "eager=w_200,h_200&public_id=sample_image&timestamp=1514500082<API_SECRET>" which you mentioned you used.

    In that case, the only reason it wouldn't have worked is due to the API SECRET. May I please ask you to double-check the value you are using for that? You can calculate the signature in the command line directly by running

    echo -n 'eager=w_200,h_200&public_id=sample_image&timestamp=1514500082<API_SECRET>' | sha1sum

    The correct signature you should get back is:

    2ef149fe190ef266c766ae5104b3193d5327e93f

    By the way, I see that you are uploading an image from your account into the same account which will create duplicates and cost you Transformation and Storage quota. Is that intentional?

    0
    Comment actions Permalink
  • Avatar
    Infodental

    Hi,

    Tanks for yours explains. I am uploading an imagem from my account. That is intentional to first test. 

    I use MacOS and try generate sha1 of the follow string into my terminal:

    echo -n 'eager=w_200,h_200&public_id=sample_image&timestamp=1514500082<API_SECRET>' | shasum

    That return:

    4c7acd1b4f6693efaa3320411018b70c4bcfdad3

    I put exactly string "<API_SECRET>" to return same your sha1 (2ef149fe190ef266c766ae5104b3193d5327e93f), but return different sha1.

    What is wrong?

    0
    Comment actions Permalink

Please sign in to leave a comment.