We are uploading a file using the Amazon AWS Java Library and are having difficulty obtaining upload progress. We’re currently calling the following:
File file = new File(localAsset.getVideoFilePath());
PutObjectRequest putObjectRequest = new PutObjectRequest(bucket, localAsset.getFileName(), file);
s3.putObject(putObjectRequest);
How can we set a callback to check up on file upload progress?
Thanks
I came upon this exact problem and wrote a simple InputStream wrapper that prints out nice progress bars:
(this is copy-and-pasted from live code, so you might have to do a few fixups to get it to work in your own code.)
Then, just use the InputStream way of putting things (make sure to specify the size!) and it will make a nice progress bar for you. If you want a proper callback that’d be pretty easy to do too.