We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f1e299 commit 5dc875fCopy full SHA for 5dc875f
src/baas/cos/index.js
@@ -335,6 +335,20 @@ class Cos {
335
})
336
}
337
338
+ async getObjectUrl(inputs = {}) {
339
+ const getObjectUrlHandler = util.promisify(this.cosClient.getObjectUrl.bind(this.cosClient))
340
+ const { Url } = await getObjectUrlHandler({
341
+ Bucket: inputs.bucket,
342
+ Region: this.region,
343
+ Key: inputs.object,
344
+ // default expire time is 15min
345
+ Expires: inputs.expires || 900,
346
+ // default is sign url
347
+ Sign: inputs.sign === false ? false : true
348
+ })
349
+ return Url
350
+ }
351
+
352
async upload(inputs = {}) {
353
console.log(`Uploding files to ${this.region}'s bucket: ${inputs.bucket} ...`)
354
0 commit comments