I am using Aws S3 resource object of AWS SDK in my Rails code to download a file from my S3 bucket this way:
s3 = Aws::S3::Resource.new(region: 'us-west-2')
obj = s3.bucket('mybucket').object( my_report_file_name)
obj.get(response_target: my_report_file_name)
The get
method in the last line shown above downloads the file from S3 bucket to the Rails server machine. I would like to download the file to the client browser directly instead.
How can I achieve this?