class Awscr::S3::FileUploader

Overview

Uploads a file to S3. If the file is smaller than 5MB it is uploaded in a single request. If the file is 5MB or greater, or if size is unknown, it is uploaded in parts.

Defined in:

awscr-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, retries : Int32 | Nil = nil) #

Upload a file to a bucket. Returns true if successful, otherwise an exception is thrown.

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

[View source]