© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
carcajou

File upload ASP .net 6

Hey,
I made an asp website to try file upload. I use file streaming in order to upload large files.

Problem: When uploading a file, I estimated at >30Mo (after a few manual tries) i get an error on the browser saying there was an error (website unreachable) and the file is not uploaded after clicking the button to Post. The website is not crashed and in case of re reaching the address the website can be accessed.
I tried to put a breakpoint on my
public async Task OnPostAsync()
public async Task OnPostAsync()
function but it never goes into that function and does the error on the browser.

When using a smaller file it does upload without an issue.
I tried multiple browser (Firefox, Chrome, Opera) but the error is the same
I use a Form and a button.
<form method="post" enctype="multipart/form-data">
<form method="post" enctype="multipart/form-data">

I'm using Visual Studio

I saw that i may have to define a longer length for body requests but it did not worked out
options.MultipartBodyLengthLimit
options.MultipartBodyLengthLimit
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Converting ASP.NET 6 to ASP.NET 5
C#CC# / help
4y ago
.NET 6 ASP.NET API [Answered]
C#CC# / help
4y ago