Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 200
ipegasus Avatar asked Jul 25 '12 19:07

ipegasus


People also ask

How do you pause a Galaxy S3 upload?

You can use tryPause as follows: // Upload a file to Amazon S3. Upload upload = transferManager. upload(BUCKET_NAME, mKey, file); // Initiate a pause with forceCancelTransfer as true. // This cancels the upload if the upload cannot be paused.

How do I upload a PDF to Amazon S3?

In the Amazon S3 console, choose the bucket where you want to upload an object, choose Upload, and then choose Add Files. In the file selection dialog box, find the file that you want to upload, choose it, choose Open, and then choose Start Upload. You can watch the progress of the upload in the Transfer pane.


2 Answers

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.

like image 135
newdark-it Avatar answered Sep 20 '22 14:09

newdark-it


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.

like image 33
Judge Mental Avatar answered Sep 19 '22 14:09

Judge Mental