0

Sample 1

Sample 2

Ok, I've been struggling with this for a few days now and can't find anything definitive to resolve this. In fact most of what I have read suggests this should work.

In summary.

I have a Windows Forms application (Dot.Net 4.7.2) sending files to an ASP.Net Core 2.2 website (not WebApi)

For whatever reason, I cannot send files or data greater than ~25MB, anything less is fine. Whatever method I use to send the file (>~25MB) response back from the server is

StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent

I've read lots of articles on this and I cannot find a solution. If fact everything I have read suggests this shouldn't even be a problem.

The code I've used is in the samples linked above

I will keep digging, but, any help would be much appreciated.

This link explains and resolves the problem

djack109
  • 1,261
  • 1
  • 23
  • 42
  • Doesn't apply as I am using Windows Forms application not an Asp.Net application :( – djack109 Apr 24 '20 at 11:53
  • [Fix and explanation](https://stackoverflow.com/questions/38698350/increase-upload-file-size-in-asp-net-core/43250595#43250595) This link explains what's going on and how to fix it – djack109 Apr 24 '20 at 12:21
  • Though all the answers there are bad as they are just about increasing the amount of bytes which are allowed to be held in memory. In general there is no need and should be no need to load everything into memory. Consequently use streams - HttpClient should write to the network stream and the ASP.Net Core controller should read from the network stream. This allows you to transmit files which are terabytes large while only using some kilobytes of memory for the whole time. – ckuri Apr 24 '20 at 20:05
  • My eventual solution was to use streams. Even though I could I don't want massive files to go across so I've limited it to 1 GB – djack109 Apr 25 '20 at 09:12

0 Answers0