Skip to content

Downloading to File or IO object for Aws::S3::Encryption::Client#get_object #794

@mlangenberg

Description

@mlangenberg

The following code example works for Aws::S3::Client, but not for Aws::S3::Encryption::Client.

File.open('filename', 'wb') do |file|
  s3_client.get_object(bucket:'bucket', key:'key', response_target: file)
end

The result is an empty file.

However passing a block seems to be a workaround.

File.open('filename', 'wb') do |file|
  block = -> chunk { file.write(chunk) }
  s3_client.get_object(bucket:'bucket', key:'key', response_target: block)
end

Is this:

  • Intended behavior?
  • Proper way to stream a file that is encrypted client-side?

Metadata

Metadata

Assignees

No one assigned

    Labels

    response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions