Contents

Building a resumable upload server with SwiftNIO

Support HTTP resumable upload protocol in SwiftNIO by translating resumable uploads to regular uploads.

Overview

Configure the sample code project

Before you run the sample code project:

  1. In the Package.swift file of an existing HTTP server project, add .package(path: "/path/to/swift-nio-resumable-upload") as one of the dependencies.

  2. Import NIOResumableUpload in your SwiftNIO bootstrapping code.

  3. Create an upload context: let uploadContext = HTTPResumableUploadContext(origin: "https://example.com").

  4. Wrap your HTTP server channel handler within HTTPResumableUploadHandler.

See Also

Uploading