我正在使用AWS Glacier存储通过aws-sdk为Node js存储旧文件。我可以将文件从本地PC上传到存储设备,但是无法将其从存储设备下载到本地。
是否可以编写代码将文件直接下载到本地而不是S3?
var params = {
accountId: "example",
jobParameters: {
Description: "My inventory job",
Type: "inventory-retrieval"
},
vaultName: "example",
};
glacier.initiateJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else {
console.log("job initated job successfully", data);
var params = {
accountId: "example",
jobId: 'example',
vaultName: "example"
};
glacier.describeJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else {
console.log('Job description ', data);
var params = {
accountId: "example",
jobId: 'example',
vaultName: "example"
};
glacier.getJobOutput(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
}
})
}
});