How to solve 413 request entity too large
You have to modify your .platform
as shown in the docs.
For example, you could have the following .platform/nginx/conf.d/myconfig.conf
with content:
client_max_body_size 20M;
response: 413 Request Entity Too Large
There are two limits you need to change. Kestrel and IIS.
You can change the MaxRequestBodySize limit of Kestrel in Program.cs.
public static IWebHost BuildWebHost(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(options =>
{
options.Limits.MaxRequestBodySize = long.MaxValue;
})
.UseIISIntegration()
.Build();
}
And the limit for IIS can be changed in web.config:<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
Why does happen request entity too large error?
When the web server that is running a website that you are trying to access decides that the HTTP data stream that your web browser is sending to it is too large (in this context, “too large” means that the data stream has way too many bytes), it will not cope with it and issue error 413.
How to fix '413 Request Entity Too Large' error in Node.js
The problem ended up not being nginx at all, I was trying to email the images as attachments via Mailgun and that has a hard limit of 25MB.
After editing this line in the section where users can upload images everything works perfectly:
let result = await cloudinary.v2.uploader.upload(file.path, {width: 1280, height: 720, crop: "limit"});
The remote server returned an error: (413) Request Entity Too Large
I've eventually managed to get this working after several hours of head scratching. I removed the binding name "BasicHttpBinding_BailiffServices" from both the <binding /> element and the <endpoint /> elements. I stumbled across this solution on the MSDN site. Hope this helps someone else.
Related Topics
Are There Any PHP Docblock Parser Tools Available
How to Use Etags in a PHP File
Force Cache Refresh After Deployment
Codeigniter $This->Input->Post() Empty While $_Post Is Working Correctly
Storing Leading Zeros of Integers in MySQL Database as Integer
Print a Webpage to PDF Document Using PHP
How to Convert Ldap Timestamp to Unix Timestamp
Datetime Now PHP MySQL (+ Pdo Variant)
MySQL and Query to Satisfy on Same Column
When Should I Close a Database Connection in PHP
How to Add Item to the JSON File Formatted Array
Zend Framework 2 - Global Check for Authentication with Zfcuser
Looping Through a Simplexml Object, or Turning the Whole Thing into an Array
Composer:How to Add a Dependency Without Network Connection