Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Latest commit

 

History

History
 
 

BrickUploader

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

BrickUploader

BrickUploader coordinates the upload of data to BrickFTP using its REST API.

Usage

let uploader = BrickUploader(with: SessionManager(),
                             baseURL: "https://example.brickftp.com",
                             apiKey: "1234567890")

uploader.progressHandler = { (completed, ofTotal) in
    print("Uploaded \(completed) of \(ofTotal) bytes")
}

let url = URL(fileURLWithPath: "/tmp/source.txt")
let path = ["dir1", "dir2", "destination.txt"]

uploader.upload(file: url, to: path) { completed, error in
    guard error == nil else {
        print("Uh oh: \(error.localizedDescription)")
    }
}