chunked-file-upload-csharp
chunked-file-upload-csharp copied to clipboard
This is a sample project to demo chunked uploading to a server built with .NET Core WebApi 2
Sample application for chunked file upload
An example to demonstrate chunked file uploading to a .NET Core WebApi 2 server. The client uses Resumable.js, which in turn uses HTML 5 file API to generate the chunks.
A Java version is also available https://github.com/edsoncunha/chunked-file-upload-sample.
How to run
Install requirements:
Run:
cd ChunkedUploadWebApi
dotnet run
Then browse to localhost:5000. API Documentation will be available on localhost:5000/api-docs.
Testing
Generate a large file with random data and compare its checksum with downloaded file's checksum.
Windows:
Create a 1GB dummy file
fsutil file createnew file.tmp 1073741824
Upload generated file.tmp, download it from server and check whether the checksums match with File Checksum Integrity Verifier Utility:
fciv -add file.tmp -sha1
Linux:
Create a 1GB file from /dev/urandom
dd if=/dev/urandom of=file.tmp bs=1M count=1024 #creates a 1GB file
Upload generated files, download it from server and check whether the checksums match with sha1sum
sha1sum file.tmp