Skip to main content

File upload using 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)   

    You can use http://www.sha1-online.com/ for generating the signature for testing purpose

    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 we got from running the above query on SHA-1 generator is-e5f898986395cf2ba6847571188a25b91d5e89a5

    Now our example curl command is: -

    curl https://api.cloudinary.com/v1_1/<your cloud name>/image/upload -X POST --data 'file=http://res.cloudinary.com/demo/image/upload/sample.jpg&timestamp= 1514500082&public_id=sample&transformation=w_200,h_200,c_limit&api_key=<your api key>&signature=e5f898986395cf2ba6847571188a25b91d5e89a5'

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

    0
  • vlhomme

    Hello ! Where can I find documentation about how to use the api with curl ?

    0
  • Sam Brace

    Thanks for your question! You should find this document here: https://cloudinary.com/documentation/admin_api#api_overview

    Yours Truly,
    -Sam

    0

Post is closed for comments.