简体   繁体   中英

How to upload to S3 with Pause/Resume support?

I would like to know how to upload a file to Amazon S3 with 'Pause and Resume' support? (Via a web browser).

Are there any sample web applications available? Any programming language / framework is fine.

Thanks in advance.

SOLUTION

I implemented the following app. Github Link .

It is based on the sample app and gem from Condominios .

All credit to https://github.com/cotag/ for a great gem and work.

FEATURES:

- Pause / Resume support ~ 5MB chunks
- Large File Upload
- Progress Bar
- No Java Applet / No Flash
- Registration system via devise

That one is a big one. I have been looking for a clean answer for that for a very long time. I even built somethings but it always comes down to using a medium for your application. I think the best solution I have found is using this. It really is a very simple idea and the great part is it only uses a small amount of flash to use.

S3 Heroku Flash Uploader

Github Source Code

However the down side is your not going to be able to upload anything successfully that is over 512 MB there is some sort of cashing fall out after that point. Loose track or something. I think the only other solution that I can think of is to build a Java Application that would handling the uploading to the server. At least then you have a more stable connection and don't have to worry about the problems with the browser.

You should build it using the multipart upload API. Here's the link for Java:

http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/mpListPartsJavaAPI.html

The idea would be to initiate a multi-part upload, start uploading parts (whose size would be based on the client's transfer rate) and whenever the user pauses the upload, stop uploading parts. You won't have byte by byte pause granularity, but I suspect the user would not notice that.

I implemented the following app. Github Link:

https://github.com/interpegasus/condo_example

It is based on the sample app and gem from:

http://cotag.github.com/Condominios/

All credit to https://github.com/cotag/ for a great gem and work.

FEATURES:

  • Pause / Resume support ~ 5MB chunks
  • Large File Upload
  • Progress Bar
  • No Java Applet / No Flash
  • Registration system via devise

Evaporate js is a pretty good plugin for this specific task.

Have a look here:

https://github.com/TTLabs/EvaporateJS

You'll need a client something like this: https://github.com/23/resumable.js

And a server that:

  1. Writes the chunks somewhere (locally or to S3)
  2. Uploads the fully-assembled file to S3.

You are not going to be able to do it straight from the browser to S3.

Update: S3 supports CORS now. http://aws.amazon.com/about-aws/whats-new/2012/08/31/amazon-s3-announces-cross-origin-resource-sharing-CORS-support/

你试过S3Fox firefox插件吗?

It has both front end and backend implmentation with S3

https://medium.com/@selvakumar.ponnusamy/resumable-file-upload-with-s3-ce039cbc8865

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM