Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Added Aws::S3::Object#upload_file abstraction. #130

Merged
merged 2 commits into from
Oct 8, 2014

Conversation

trevorrowe
Copy link
Contributor

The #upload_file method makes it easy to upload a file from disk to S3:

# given a S3::Object
obj = Aws::S3::Resource.new.bucket('aws-sdk').object('key')

# upload the file from the given path
obj.upload_file('path/to/source')

You can pass a String, Pathname, File, or Tempfile to #upload_file. If the file is larger than 15MB, it will be uploaded using the Amazon S3 multipart upload APIs.

# upload large files in parts
obj.upload_file('/path/to/large-file')

The `#upload_file` makes it easy to upload a file from disk
to S3:

    # given a S3::Object
    obj = Aws::S3::Resource.new.bucket('aws-sdk').object('key')

    # upload the file from the given path
    obj.upload_file('path/to/source')

You can pass a String, Pathname, File, or Tempfile to `#upload_file`.
If the file is larger than 15MB, it will be uploaded using the Amazon S3
multipart upload APIs.

    # upload large files in parts
    obj.upload_file('/path/to/very-large-file')
This bug was exposed by the multipart-upload abstraction
unit tests.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) when pulling 58592a4 on s3-object-upload-file into 71b541a on master.

trevorrowe added a commit that referenced this pull request Oct 8, 2014
Added Aws::S3::Object#upload_file abstraction.
@trevorrowe trevorrowe merged commit 3c5a7a8 into master Oct 8, 2014
@trevorrowe trevorrowe deleted the s3-object-upload-file branch November 26, 2014 17:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants