Aside from using the OSS Node.js SDK, you can download objects stored in OSS over HTTP.

HTTP-based download supports browsers and command line interface (CLI) tools such as wget and curl. The URL of an object is generated by using SDKs.

Note You can use the signatureUrl method to generate an HTTP-based URL that can be used for downloads. By default, the validity period of a URL is set to 3,600 seconds. There is no upper limit applicable to the validity period. However, for security reasons, we recommend that you do not set the validity period of a URL to too long.

The following code provides an example on how to download an object from OSS over HTTP:

let OSS = require('ali-oss');

let client = new OSS({
  region: '<Your region>',
  accessKeyId: '<Your AccessKeyId>',
  accessKeySecret: '<Your AccessKeySecret>',
  bucket: '<Your bucket name>',

let url = client.signatureUrl('object-name');

let url = client.signatureUrl('object-name', {expires: 3600});

// Generate the signed URL that allows HTTP PUT requests.
let url = client.signatureUrl('object-name', {method: 'PUT'});