2

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.

user8609610
  • 41
  • 1
  • 3
  • The docs seem to imply that setting the response.ContentLength64 property may result in chunked data. Some other fiddling might be necessary. Doc [here](https://msdn.microsoft.com/EN-US/library/ms144079(v=VS.110,d=hv.2).aspx) – C. Gonzalez Sep 14 '17 at 15:30

1 Answers1

2

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

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

That made it work for me.

user8609610
  • 41
  • 1
  • 3