Coder Social home page Coder Social logo

tus-dotnet-client's Introduction

tus-dotnet-client

.Net client for tus.io Resumable File Upload protocol.

Features

  • tus protocol v1.0.0
  • protocol extension supported: Creation, Termination
  • no external dependencies
  • upload progress events
  • .net 4.0 / .net standard 2.0 / .net core 2.0 / .net core 3.1
  • used in production for .net 4.0 desktop app
  • small enought to copy into your project

Usage

See TusClientConsole for usage and a test suite of sorts.

Dim tc As New TusClient.TusClient()
AddHandler tc.Uploading, Sub(bytesTransferred As Integer, bytesTotal As Integer)
                             Dim perc As Decimal = bytesTransferred / bytesTotal * 100.0
                             Console.WriteLine("Up {0:0.00}% {1} of {2}", perc, bytesTransferred, bytesTotal)
                         End Sub

Dim fileURL = tc.Create(ServerURL, testfile)
tc.Upload(fileURL, testfile)
tc.Delete(fileURL)

Alternatives

If async support or Nuget is important to you check out these other great dotnet tus clients:

License

MIT

tus-dotnet-client's People

Contributors

gerdus avatar svilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tus-dotnet-client's Issues

Header name case-insensitive

Hello according to rfc2616, Message Headers Field names are case-insensitive.
I faced with problem that Envoy (CONTOUR) are transforms response headers to lower cases, and clients throws exception "Offset Header Missing" code

Thank you.

The Tus client uses a deprecated cryptographic function to calculate the checksum of Upload-Checksum

SHA-1 is not collision-resistant, which makes it easier for context-dependent attackers to conduct tampering attacks and alter the checksum which makes it possible to alter the file being uploaded itself. For a long time, it has been possible "to find collisions for SHA1 and that thus it is not secure to use for digital signatures, file integrity, and file identification purposes". see: https://arstechnica.com/information-technology/2017/02/at-deaths-door-for-years-widely-used-sha1-function-is-now-dead/

Also:
https://www.cvedetails.com/cve/CVE-2005-4900/
https://cwe.mitre.org/data/definitions/328.html

Finding: https://github.com/gerdus/tus-dotnet-client/blob/master/TusClient/TusClient.cs#L154

Automatic retries

Should implement automatic retries just like the official js client.

Add Instructions for HTTPS

Add instructions for client to specify SecurityProtocol if https schema.

C# .NET

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

Powershell:

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12

The Uploading is async or sync method?

when i use this client in WPF to upload file, when the file uploading, the application window was frozen.
please help me to how to fix it.thanks!
private void Client_Uploading(long bytesTransferred, long bytesTotal) { double alreadyTransferred = (double)bytesTransferred; double total = (double)bytesTotal; currentPercent = (int)((alreadyTransferred / total) * 100); txtStatus.Dispatcher.Invoke(() => txtStatus.Text = string.Format(" {0} %", currentPercent)); progressBar.Dispatcher.Invoke(() => progressBar.Value = currentPercent); }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.