Updated to support s3 upload.