File upload using curl
I want to upload a file using curl, how to create a signature in the curl request ?
else
if I want to upload using unsign in curl what parameter need to passed in the request?
-
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>×tamp= <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×tamp=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×tamp= 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 -
Hello ! Where can I find documentation about how to use the api with curl ?
0 -
Thanks for your question! You should find this document here: https://cloudinary.com/documentation/admin_api#api_overview
Yours Truly,
-Sam0
Post is closed for comments.
Comments
3 comments