def upload region = 'XXXX' bucket = "#{bucket_name}" # S3バケット名 key = "#{key}" #S3のファイル名 client = Aws::S3::Client.new(region: region) upload_file = params[:file] client.put_object(bucket: bucket, key: key, body: upload_file.read) end def download region = 'XXX' bucket = "#{bucket_name}" # S3バケット名 key = "#{key}" #S3のファイル名 client = Aws::S3::Client.new(region: region) data = client.get_object(:bucket