Can I upload using DATA URI (BASE64)?

Follow

Comments

5 comments

  • Avatar
    Julian Rubisch

    Using the exact data URI of this example (and using a pure HTTP POST request to my cloud), I get the error message

    Unsupported source URL: data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4%2F%2F8%2Fw38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg%3D%3D

    everything else (signature) being obviously correct. How can I debug this? Thanks!

    0
    Comment actions Permalink
  • Avatar
    Aditi Madan

    Hi Julian,

    How are you uploading this image? Can you share the code and your account's cloud name and I will be able to look into it deeper. If privacy is a concern then please feel free to open a support ticket here: https://support.cloudinary.com/hc/en-us/requests/new with the details and we will be happy to help.

    Thanks,

    Aditi

    0
    Comment actions Permalink
  • Avatar
    Julian Rubisch

    Hi Aditi,

    thanks for your response, much appreciated! I'm just evaluating some aspects of cloudinary...

    anyway, the request is a simple cURL command:

    curl -X POST https://api.cloudinary.com/v1_1/minthesize/image/upload -F file=data%3A... -F api_key=<my_api_key> -F timestamp=1563288717 -F signature=<SHA-1>

    Seemingly, the signature is correct, otherwise I suspect I'd get a different error message. Nothing fancy, really

    0
    Comment actions Permalink
  • Avatar
    Aditi Madan

    Hi Julian,

    I just tested uploading the same data URI image with curl and it uploaded successfully. 

    Here is the command I used:

    curl -X POST https://api.cloudinary.com/v1_1/<cloud name>/image/upload --data 'file=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4%2F%2F8%2Fw38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg%3D%3D&timestamp=1563412399&public_id=curlPost&api_key=<your api key>&signature=<sha-1 signature>'

    Please open a support ticket here: https://cloudinary.zendesk.com/agent/ if you continue having problem uploading image. Please include your cloud name in the ticket and we will be able to debug it further.

    Thanks,
    Aditi

    0
    Comment actions Permalink
  • Avatar
    Julian Rubisch

    ah, it's a x-www-form-urlencoded post, not formdata... that was my mistake, thanks!

    0
    Comment actions Permalink

Please sign in to leave a comment.