Skip to content

Commit 37fa747

Browse files
committed
Updating readme with upload examples
1 parent 2e9c84f commit 37fa747

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.project

.project

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>cloudinary_npm</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,22 @@ Same goes for Twitter:
8686
Assuming you have your Cloudinary configuration parameters defined (`cloud_name`, `api_key`, `api_secret`), uploading to Cloudinary is very simple.
8787

8888
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) })
8993

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' }
91105

92106
The uploaded image is assigned a randomly generated public ID. The image is immediately available for download through a CDN:
93107

@@ -97,7 +111,7 @@ The uploaded image is assigned a randomly generated public ID. The image is imme
97111

98112
You can also specify your own public ID:
99113

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'})
101115

102116
cloudinary.url("sample_remote.jpg")
103117

0 commit comments

Comments
 (0)