c# - httpRuntime 元素的 System.web 设置

标签 c# asp.net asp.net-web-api

我正在尝试上传文件,这是我的设置

<system.web>
<compilation debug="true"  />
<httpRuntime  executionTimeout="110"
 maxRequestLength="4096"
 requestLengthDiskThreshold="256"
 useFullyQualifiedRedirectUrl="false"
 minFreeThreads="8"
 minLocalRequestFreeThreads="4"
 appRequestQueueLimit="5000"
 enableKernelOutputCache="true"
 enableVersionHeader="true"
 requireRootedSaveAsPath="true"
 enable="true"
 shutdownTimeout="90"
 delayNotificationTimeout="5"
 waitChangeNotification="0"
 maxWaitChangeNotification="0"
 enableHeaderChecking="true"
 sendCacheControlHeader="true"
 apartmentThreading="false"
/></system.web>

这里我将 maxRequestLength 设置为 4MB,但我最多只能上传 500kb。 我尝试了多种设置,但无法获得任何解决方案。 我应该在哪里更改才能使其正常工作?

最佳答案

请看https://stackoverflow.com/a/41118265/1498669其中详细描述了两个参数(IIS 和 WCF)(一个以千字节为单位,另一个以字节为单位)。

关于c# - httpRuntime 元素的 System.web 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34067244/

相关文章:

c# - 注入(inject)的 IPrincipal 是匿名的,但 Web API Controller 用户对象已通过身份验证

c# - 在 asp.net 核心应用程序中配置 log4net AdoNetAppender

C# object[] 到定界字符串

asp.net - 如何通过 ADO.NET 运行 .sql 脚本文件?

c# - 为什么 [EnableCors ("*"、 "*"、 "*")] 不允许所有请求?

javascript - 无法使 SignalR、Web API 和 SystemJS 一起工作

c# - 如何在 ASP.NET Web API 内存测试中添加客户端证书?

c# - 为什么 "new int[n] is object[]"是假的?为什么 "int[] is object[] arr"是模式错误?

c# - 退出 SharpDX 渲染循环

c# - Lambda表达式获取3个字段值