@@ -86,8 +86,22 @@ Same goes for Twitter:
86
86
Assuming you have your Cloudinary configuration parameters defined (` cloud_name ` , ` api_key ` , ` api_secret ` ), uploading to Cloudinary is very simple.
87
87
88
88
The following example uploads a local JPG to the cloud:
89
+
90
+ var cloudinary = require('cloudinary')
91
+
92
+ cloudinary.uploader.upload("my_picture.jpg", function(result) { console.log(result) })
89
93
90
- cloudinary.uploader.upload("my_picture.jpg")
94
+ Below is an example of an upload's result:
95
+
96
+ { public_id: '4srvcynxrf5j87niqcx6w',
97
+ version: 1340625837,
98
+ signature: '01234567890abcdef01234567890abcdef012345',
99
+ width: 200,
100
+ height: 200,
101
+ format: 'jpg',
102
+ resource_type: 'image',
103
+ url: 'http://res.cloudinary.com/demo/image/upload/v1340625837/4srvcynxrf5j87niqcx6w.jpg ',
104
+ secure_url: 'https://d3jpl91pxevbkh.cloudfront.net/demo/image/upload/v1340625837/4srvcynxrf5j87niqcx6w.jpg ' }
91
105
92
106
The uploaded image is assigned a randomly generated public ID. The image is immediately available for download through a CDN:
93
107
@@ -97,7 +111,7 @@ The uploaded image is assigned a randomly generated public ID. The image is imme
97
111
98
112
You can also specify your own public ID:
99
113
100
- cloudinary.uploader.upload("http://www.example.com/image.jpg ", {public_id: 'sample_remote'})
114
+ cloudinary.uploader.upload("http://www.example.com/image.jpg ", function(result) { console.log(result) }, {public_id: 'sample_remote'})
101
115
102
116
cloudinary.url("sample_remote.jpg")
103
117
0 commit comments