首页 > 解决方案 > 使用 AWS Amplify 将文件上传到 S3 时获取上传进度状态

问题描述

我正在使用aws-amplifysdk 通过 Angular 将文件上传到 S3,我想查看已将多少文件上传到存储桶。

Storage.put(id, name)
    .then (result => console.log(result))
    .catch(err => console.log(err)).on('httpUploadProgress', function(progress) {
    // Here you can use `this.body` to determine which file this particular
    // event is related to and use that info to calculate overall progress.
});

这不起作用,我似乎无法找到解决方案。

标签: angularamazon-web-servicesamazon-s3amazon-cognitoaws-amplify

解决方案


Amplify 文档现在包括这个 - https://aws-amplify.github.io/docs/js/storage#put


推荐阅读