Ajax – Upload File Directly to S3 with Progress Bar

ajaxamazon s3file uploadprogress-bar

Relating to this question, Upload files directly to Amazon S3 from ASP.NET application, is there any way to do this and have a progress bar?

—- EDIT —-

Two days later and still no luck with a direct way. Found one thing that looks promising but not free: http://www.flajaxian.com/

Uses flash to upload directly to S3 with a progress bar.

Best Answer

I'm looking for a solution as well. Maybe this will be of some help,

From AWS Dev Commnity But in many languages (PHP, Java), for big files, you have to use streams through which the language environment will take chunks of your big file one after the other (in order to fill up central memory with huge amount of data for the http POST of S3 needed for the upload.

The nice thing about stream is that they have a callback called whenever the next chunk is read for to further PUT (in the https sense) data to S3. You can use this callback to compute and display the progress on the client UI.

See the doc of libcurl to see in details how all this works.

Update: It looks like there are two straightforward options.

  1. Flash, via the FileReference class
  2. With a Java applet

I personally hate using 3rd party extensions (Flash, Java) to make an app function, but I haven't found another way.