Added an option to resume failed upload.
Make into a gem.