views:

47

answers:

1

Am a beginner of S3 AWS SDK. and getting problem in my project.

I want to get uploaded or downloaded size of file which is currently uploaded. Actually the functionality of my application is that it will upload contents directly from client browser to Amazon S3. But if transfer of data interrupted and if exception is raised then i cant track that how much data of file has be transfered.

If anybody has a solution, please reply.

Thanks

A: 

First of all you will not find a "last transaction" functionality in S3. S3 is not transactional, it is a giant hashtable. If your upload fails the item will not exist in your bucket, even if it failed half way though.

Having said that your best option here is to use Flash or Silverlight to upload the file. This way you have access to the file size on the client and can added the appropriate meta tags when uploading the file. It also allows you to give an accurate progress bar.

Have a look at this example.

willbt