edit-icon download-icon

Download objects

Last Updated: Jan 23, 2018

You can download an object from OSS using any of the following methods:

  • HTTP download (using a browser).

You can use the signatureUrl method in the browser to generate the downloadable HTTP address.The validity period of the URL is half an hour by default:

  1. var co = require('co');
  2. var OSS = require('ali-oss');
  3. var client = new OSS({
  4. region: '<Your region>',
  5. accessKeyId: '<Your AccessKeyId>',
  6. accessKeySecret: '<Your AccessKeySecret>',
  7. bucket: 'Your bucket name'
  8. });
  9. var url = client.signatureUrl('object-key');
  10. console.log(url);
  11. var url = client.signatureUrl('object-key', {expires: 3600});
  12. console.log(url);
Thank you! We've received your feedback.