-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 054e1c1
Showing
21 changed files
with
12,312 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
node_modules | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# cos-js-sdk-v5 | ||
|
||
腾讯云 COS JS SDK([XML API](https://www.qcloud.com/document/product/436/7751)) | ||
|
||
[releases and changelog](https://github.com/tencentyun/cos-js-sdk-v5/releases) | ||
|
||
## npm 安装 | ||
|
||
[npm 地址](https://www.npmjs.com/package/cos-js-sdk-v5) | ||
|
||
``` | ||
npm i cos-js-sdk-v5 --save | ||
``` | ||
|
||
## get started | ||
|
||
```javascript | ||
var cos = new COS({ | ||
AppId: '1250000000', | ||
getAuthorization: function (options, callback) { | ||
$.get('../server/auth.php', { | ||
method: (options.method || 'get').toLowerCase(), | ||
pathname: options.pathname || '/' | ||
}, function (authorization) { | ||
callback(authorization); | ||
}, 'text'); | ||
} | ||
}); | ||
// 分片上传 | ||
cos.sliceUploadFile({ | ||
Bucket: 'test', | ||
Region: 'cn-south', | ||
Key: '1.zip', | ||
Body: file | ||
}, function (err, data) { | ||
console.log(err, data); | ||
}); | ||
``` | ||
|
||
[更多例子](demo/demo.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var config = { | ||
AppId: '1250000000', | ||
Bucket: 'test', | ||
Region: 'cn-south' | ||
}; |
Oops, something went wrong.