Method: Aws::S3::Object#download_file
- Defined in:
- lib/aws-sdk-resources/services/s3/object.rb
#download_file(destination, options = {}) ⇒ Boolean
Downloads a file in S3 to a path on disk.
# small files (< 5MB) are downloaded in a single API call
obj.download_file('/path/to/file')
Files larger than 5MB are downloaded using multipart method
# large files are split into parts
# and the parts are downloaded in parallel
obj.download_file('/path/to/very_large_file')
282 283 284 285 286 287 |
# File 'lib/aws-sdk-resources/services/s3/object.rb', line 282 def download_file(destination, = {}) downloader = FileDownloader.new(client: client) downloader.download( destination, .merge(bucket: bucket_name, key: key)) true end |