1
votes

I have been trying to upload a File larger than 4MB that is default limit in ASP.NET. All other files less than 4MB are being uploaded without any issue. But files with larger size than 4MB are giving following error in Chrome Console...

Failed to load resource: the server responded with a status of 404 (Not Found)

I have tried setting maxRequestLength & requestLimits ( maxAllowedContentLength) in WebConfig but still getting same error.

I am using Visual Studio 2017 & Target Framework 4.6.1

1
Can you share your web.config please?Mavi Domates
Please see webconfig file here.. pastebin.com/iivNsnafHumaira

1 Answers

0
votes

Well - take a look at the documentation snapshot from below link: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/requestfiltering/requestlimits/

enter image description here

So your configuration is in bytes. And you have in your configuration:

<requestFiltering>
    <requestLimits maxAllowedContentLength="1048576" />
</requestFiltering>

which means you can upload at max around 1MB. You should increase that value to something like 1073741824 - that's 1GB there for you. This should resolve your upload problem.