I tried to use Amazon-SDK(Java) sample code S3TransferProgressSample.java
to upload large files to Amazon-S3 storage (also posted here on AWS docs).
But
I wanted to add a comment to Geoff Appleford's answer but SO wouldn't allow me to. In general his answer to use low level API works fine but even if we do now have a do-while loop the way for loop is designed there is in-built retry logic. In his code snippet the file position increases only when there is a success otherwise you are uploading the same part again.