asp.net - 有“远程服务器返回意外响应:(413) 请求实体太大。”
问题描述
上传超过 50 KB 的文件时出现错误。
我的服务配置是
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings configProtectionProvider="DataProtectionConfigurationProvider"> <connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>......</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>
<appSettings configProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>.....</CipherValue>
</CipherData>
</EncryptedData>
</appSettings>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.6.1" />
</system.Web>
-->
<system.web>
<compilation targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICreateRequestService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://myserver/myservice/CreateRequestService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICreateRequestService" contract="CreateRequestService.ICreateRequestService" name="BasicHttpBinding_ICreateRequestService" />
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
我尝试了建议的选项,但没有成功(maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647")等等
有没有进一步的建议
最好的问候埃雷兹
解决方案
推荐阅读
- javascript - 检查表单字段中的值
- c# - Azure v1 ServiceBusTrigger 函数不接收消息
- shell - mailx如何通过命令重复传递消息
- excel - 选择具有多个真实条件的语句 Excel vba
- regex - 正则表达式:选择小于 4 个字符的单词
- scala - InternalCompilerException:编译类是通过不同的加载器加载的
- python - 在 Python doctest 中限制浮点精度比较的最佳方法
- java - 提取xmlObject中的xml元素和子元素
- javascript - 使用 console.log 检查 FormData 对象
- java - 计算一个二次方程 - OOP Java switch case