- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当发布一个可以包含一个或多个文件(作为 base64 字符串)的请求时,我收到以下错误响应:
ERROR 2018-11-22 09:54:18,244 [13 ] Mvc.ExceptionHandling.AbpExceptionFilter - The remote server returned an unexpected response: (413) Request Entity Too Large. System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (413) Request Entity Too Large. at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.b__0(IAsyncResult asyncResult) --- End of stack trace from previous location where exception was thrown --- at ...
<configuration>
<system.webServer>
....
<asp>
<limits maxRequestEntityAllowed="2147483648"/>
</asp>
<serverRuntime uploadReadAheadSize="2147483647" />
</system.webServer>
</configuration>
最佳答案
您需要更改两个限制。红隼和 IIS。
您可以在 Program.cs 中更改 Kestrel 的 MaxRequestBodySize 限制。
public static IWebHost BuildWebHost(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(options =>
{
options.Limits.MaxRequestBodySize = long.MaxValue;
})
.UseIISIntegration()
.Build();
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
关于c# - 响应 : 413 Request Entity Too Large,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53428474/
我是一名优秀的程序员,十分优秀!