ruby/example_code/s3/upload_object_presigned_url.rb
def run_me
  bucket_name = 'doc-example-bucket'
  object_key = 'my-file.txt'
  object_content = 'This is the content of my-file.txt.'
  region = 'us-west-2'
  s3_resource = Aws::S3::Resource.new(region: region)

  unless object_uploaded_to_presigned_url?(
    s3_resource,
    bucket_name,
    object_key,
    object_content
  )
    puts "Content '#{object_content}' not uploaded to '#{object_key}' " \
      "in bucket '#{bucket_name}'."
  end
end
# Replace us-west-2 with the AWS Region you're using for Amazon S3.
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .
def run_me
  bucket_name = 'doc-example-bucket'
  object_key = 'my-file.txt'
  object_content = 'This is the content of my-file.txt.'
  region = 'us-west-2'
  s3_resource = Aws::S3::Resource.new(region: region)
  unless object_uploaded_to_presigned_url?(
    s3_resource,
    bucket_name,
    object_key,
    object_content
  )
    puts "Content '#{object_content}' not uploaded to '#{object_key}' " \
      "in bucket '#{bucket_name}'."
  end
end
def run_me bucket_name = 'doc-example-bucket' object_key = 'my-file.txt' object_content = 'This is the content of my-file.txt.' region = 'us-west-2' s3_resource = Aws :: S3 :: Resource . new ( region : region ) unless object_uploaded_to_presigned_url? ( s3_resource , bucket_name , object_key , object_content ) puts "Content '#{object_content}' not uploaded to '#{object_key}' " "in bucket '#{bucket_name}'." end end
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .