8000 GitHub - linuxy/Tus.Client: A Native AOT compatible C# client for the tus resumable upload protocol. · GitHub
[go: up one dir, main page]

Skip to content

About

A Native AOT compatible C# client for the tus resumable upload protocol.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Tus.Client

A Native AOT compatible C# client for the tus resumable upload protocol.

Features

  • Implements the tus v1.0.0 protocol
  • Supports resumable uploads
  • Native AOT compatible
  • Configurable chunk size
  • Progress tracking
  • Metadata support
  • URL storage for resuming uploads

Installation

dotnet add package Tus.Client

Usage

// Create a client
var client = new TusClient("http://your-tus-server.com");

// Enable resuming (optional)
var urlStore = new InMemoryTusUrlStore();
client.EnableResuming(urlStore);

// Upload a file with progress tracking
var progress = new Progress<double>(p => Console.WriteLine($"Upload progress: {p:P2}"));
var filePath = "example.txt";
var fingerprint = GetFingerprint(filePath);

try
{
    // Try to resume an upload, or create a new one if it doesn't exist
    var uploadInfo = await client.ResumeOrCreateUploadAsync(filePath, fingerprint);
    Console.WriteLine($"Upload completed. Final offset: {uploadInfo.Offset:N0}");
}
catch (Exception ex)
{
    Console.WriteLine($"Error: {ex.Message}");
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Native AOT compatible C# client for the tus resumable upload protocol.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0