Initialization code and common errors for uploading and downloading files in Node.js SDK
Updated at:
Overview
This topic describes the initialization codes and common errors that are returned when you upload or download objects in Node.js SDK.
Detail
Initialize the SDK
The SDK initialization code is as follows:
var oss = require('ali-oss'); var store = oss({ accessKeyId: 'your access key', accessKeySecret: 'your access secret', bucket: 'your bucket name', region: 'oss-cn-hangzhou',
stsToken: 'token', // this parameter is required if you use sts.
secure: true // this parameter is required for https});
Common errors
The following table lists the errors common to SDK upload and download.
ClientError
ClientError is an internal SDK error such as incorrect parameter setting or object modification during resumable Upload Upload or resumable upload and download.
ServerError
- status: the HTTP status code of the error request
- code:OSS error code
- message:OSS error message.
- requestId: The UUID that uniquely identifies the request.
Application scope
- OSS
Is this page helpful?