Http server in c# supporting chunked Transfer-Encoding

5.7k views Asked by At

I am looking for a way to create a HttpServer in C# that supports the chunked Transfer-Encoding for multipart-form posts. Reason is that I need to transfer large files (2-10GB) and the client application has to use the chunked transfer-encoding - else it runs out of memory when loading the file into memory. I have looked though the web and found quite a lot of examples that are using the System.Net.HttpListener class in .Net but I was not able to get that one to work with receiving data from a client that uses the chunked Transfer-Encoding.

Does anyone have an example of how to do that?

Any hint is greatly appreciated.

1

There are 1 answers

0
user8609610 On

after trying more I wound the solution: You only need to set

httpWebRequest.SendChunked = true;
httpWebRequest.AllowWriteStreamBuffering = !Chunked;

That made it work for me.