Code2night
  • Home
  • Guest Posts
  • Tutorial
  • Languages
    • Angular
    • C
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • SQL Server
    • TypeScript
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
  • Register
  • Login
  1. Home
  2. Blogpost

Maximum request length exceeded

Date- Jul 18,2022

8459

Max Request Length AspNet MVC

Maximum Request Size

Request size refers to the total size of request inlcluding uploaded files or attachments that a web applications allows. By default, a Asp.Net web application supports 4MB of request size or you can say the upload of 4 MB file is allowed at max whenever the size exceeds it throws error Maximum request length exceeded. For solving this error go to your web config and add this

 <system.web>
    <compilation debug="true" targetFramework="4.7.2" />
    <httpRuntime targetFramework="4.7.2"  maxRequestLength="1048576" /> 
 </system.web>


So, we have to add maxRequestLength attribute on httpRuntime. This line must always be under System.Web tag in web config. In this you can increase the length size to whatever you want. And the entered value is in kb.

<httpRuntime targetFramework="4.7.2"  maxRequestLength="1048576" /> 

Here after adding this in web config, now run your Asp.Net mvc web application . Maximum request length exceeded error should be fixed.

S
Shubham Batra
Programming author at Code2Night — sharing tutorials on ASP.NET, C#, and more.
View all posts →

Related Articles

Image Compression in Asp.net MVC
Jul 16, 2022
Import Excel in Asp.net MVC using OLE DB
Jun 23, 2022
Excel Export in Asp.Net MVC using XlWorkbook
Jun 11, 2022
Understanding Interfaces in C#: A Comprehensive Guide
Mar 15, 2026

Comments

Tags

Swagger UI
Swashbuckle
SwashbuckleAspNetCore
Rest API
Postman
Api Testing
ITextSharp
Export to Pdf
AspNet Core
AspNet
C#
View to Pdf in Aspnet
Scheduler
Fibonacci series in Java
Display Fibonacci Series
First C# Program
What is C?
C
C Programming
CodeLobster
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, India   info@code2night.com

Quick Links
  • Home
  • Blogs
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • XML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • PDF Editor
By Language
  • Angular
  • C
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Built with for developers