I'm using Tus.io (Resume-able File Upload Library) .Net Client library to upload files to a web server.
Here is the code snippet:
Dim testfile = My.Computer.FileSystem.GetFileInfo("..\..\test.pptx")
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)
Upload functions works well for small files e.g. 500kb file but not for the files with size 3MB or greater. It throws exception after transferring 100% data(As per % given by Uploading Event).
Exception: WebException
Message: The remote server returned an error: (460) Unknown.
Response Content: "Header Upload-Checksum does not match the checksum of the file"
Status: ProtocolError {7}
Do let me know if any required information is missing here. Any solution or quick workaround would be highly appreciated. Thanks.
PS. I couldn't add Tus.io tag due to limited privileges.
The tus.io .NET client library has included a "check-sum" header, which is causing the client to throw this error. Easiest solution right now is to remove or comment out the following line, recompile, and you would be good to go.
TusClient.cs
line 150: request.AddHeader("Upload-Checksum", "sha1 " + Convert.ToBase64String(sha1hash));