Using aws-sdk to download files from s3. Encoding not right
问题 I am trying to use aws-sdk to load s3 files to local disk, and question why my pdf file (which just has a text saying SAMPLE PDF) turns out with an apparently empty content. I guess it has something to do with the encoding...but how can i fix it? Here is my code : require 'aws-sdk' bucket_name = "****" access_key_id = "***" secret_access_key = "**" s3=AWS::S3.new( access_key_id: access_key_id, secret_access_key: secret_access_key) b = s3.buckets[bucket_name] filen = File.basename("Sample.pdf"