tempfile = Tempfile.new
csv_string = 'あ,い,う'
File.write(tempfile.path, csv_string, encoding: Encoding::SJIS)
s3_object.upload_file(tempfile.path)
s3_object.upload_file(
tempfile.path,
content_disposition: 'attachment; filename="example.csv"',
content_type: 'text/csv'
)
tempfile.close
tempfile.unlink
s3_object.presigned_url(:get, expires_in: 60 * 60)
ref
Class: Aws::S3::Client — AWS SDK for Ruby V2
https://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Client.html
Original by Github issue
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。