我是AWS的新手,我需要使用JS SDK取消上传过程,并且有一个代码示例,我尝试上传图片并取消上传过程:
var test = s3.upload({
Key: fileKey,
Body: myfile,
ACL: 'private'
},
function (err, data) {
if (err) {
} else {
}
});
$("#cancel_Button").on("click", function () {
s3.abortMultipartUpload(
params = {
Bucket: data.bucket,
Key: data.key,
UploadId: undefined
},
function (err, data) {
if (err)
console.log(err, err.stack);
else
console.log(data);
}
)
});