Skip to main content

Signed bulk upload with curl

Comments

3 comments

  • Aditi Madan

    Hi,

    Structure of the curl image upload: curl https://api.cloudinary.com/v1_1/<cloud_name>/image/upload -X POST --data 'file=<url of image>&timestamp= <current unix timestamp>&public_id=<insert public_id>&transformation=<insert transformation>&api_key=<your api key>&signature=<generated signature>'   

    If we want to upload sample image with transformation w_200,h_200,c_limit and public id=sample then the signature will be comprised of

    1. public id 

    2. timestamp(epoch timestamp)

    3. transformation and 

    4. generated API secret/signature(Note that this is not your account API secret key but a generated signature)   

    In this case the signature parameters will be - public_id=sample&timestamp=1514500082&transformation=w_200,h_200,c_limit<Insert your API secret here without comma or space> 

    The signature is generated using SHA-1. Since you are using signed upload, you don't need to use upload preset. 

    For more information on signatures: https://cloudinary.com/documentation/upload_images#creating_api_authentication_signatures

    Regards,
    Aditi

    0
  • FTITest

    Hello Aditi,

    I rewrote the code exactly how you wrote:

    curl -k https://api.cloudinary.com/v1_1/%cloud%/image/upload -X POST --data "file=%ImageDir%\%%a&timestamp=15741687674&public_id=%%a&api_key=<somekey>&signature=<somesignature>"

    but I got the message

    "message":"Unsupported source URL: Images2\\IM04933

    why are here two backslashes? the curl comman I've only one. How can I upload local files?

    Could you help me to fix this? Why can't I transmit simply the api key and secret via https?

    Best regards

    0
  • Aditi Madan

    Hi,

    Can you please open a support ticket here: https://support.cloudinary.com/hc/en-us/requests/new and share all the params you passed including the parameters you used to generate the signature and I will be able to assist you better.

    Regards,
    Aditi

    0

Post is closed for comments.