You most likely have to read the incoming data. Depends on the framework. The tcp connection is reused so if you don’t read all of the sent data then the next request will be corrupted. 

I am not sure why it works with small files - I guess that the framework is reading some of the data into the request body buffer - and if it reads the full request body in doing so that would explain it. 

On Aug 2, 2024, at 12:35 PM, Denis Korovin <krvn....@gmail.com> wrote:

Hi everyone,

I'm running into an issue with my Go server when trying to upload files around 10MB using a simple file upload form. In my browser, I'm seeing a "The connection was reset" error, and I'm not sure what is causing this problem or how to fix it.

Here’s my current setup:  https://go.dev/play/p/7TVn-njfeiH

When I attempt to upload a file around 10MB through this form, the browser gives me a "The connection was reset" error. I’ve verified that smaller files upload without any issues.

My uploadHandler currently does nothing but send a 200 OK status. Ideally, I'd like to process the file upload without reading it entirely into memory, to handle larger file uploads efficiently.

Can anyone help me understand why I'm getting this error and how to properly handle large file uploads without reading them completely into memory? Any guidance or examples would be greatly appreciated.

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/f9cbb87f-c597-4249-a13e-fbc634b38e1bn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/22E935CC-E806-498F-8ECB-4487A6783965%40ix.netcom.com.

Reply via email to