【问题标题】:System.web setting for httpRuntime ElementhttpRuntime 元素的 System.web 设置
【发布时间】:2018-08-06 12:05:22
【问题描述】:

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

<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。 我尝试了多种设置,但没有得到任何解决方案。 我应该去哪里让它工作?

【问题讨论】:

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


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    RCA:当我上传文件时,一段时间后我正在执行 location.realod() 以获取最新数据。 它在处理高达 500kb 的文件时工作正常,因为当时上传了这么多文件大小,但如果大小更大,它需要时间并且在它成功之前 location.realod() 被调用。

    Solved: used callback and instead of loading full page, just call the getAll method.
    

    【讨论】:

      猜你喜欢
      • 2014-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多