Reputation: 1
I am uploading a file through angular to S3 using aws-amplify
sdk and i want to see how much file has been uploaded to the bucket.
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.
});
This does not work and i cannot seem to find a solution for it.
Upvotes: 0
Views: 2537
Reputation: 31
Amplify docs include this now - https://aws-amplify.github.io/docs/js/storage#put
Upvotes: 3
Reputation: 3047
Upload progress is possible to get for the Storage API (aws-amplify). But it is still not documented in official doc.
Try this
Storage.put(id, name, {
progressCallback(progress) {
console.log(`Uploaded percentage: ${progress.loaded}/${progress.total}`);
},
});
Upvotes: 2