class Aws::S3::FileUploader

Overview

Uploads a file to S3. If the file is 5MB it is uploaded in a single request. If the file is greater than 5MB it is uploaded in parts.

Defined in:

aws/s3/file_uploader.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(client : Client, options : Options = Options.new(with_content_types: true)) #

[View source]

Instance Method Detail

def content_type_header(io : IO) #

[View source]
def upload(bucket : String, object : String, io : IO, headers : Hash(String, String) = Hash(String, String).new) #

Upload a file to a bucket. Returns true if successful, otherwise an Http::ServerError is thrown.

uploader = FileUpload.new(client)
uploader.upload("bucket1", "obj", IO::Memory.new("DATA!"))

[View source]