【问题标题】:Increase the maximum request length in a Azure Api App增加 Azure Api 应用程序中的最大请求长度
【发布时间】:2015-09-29 02:57:09
【问题描述】:

我创建了一个 Azure Api 应用程序,我将使用它来上传文件。这些文件将> 4mb,因此需要增加最大请求长度。我在 Web.config 中添加了以下内容:

 <system.web>
    <httpRuntime executionTimeout="7200" targetFramework="4.5" maxRequestLength="2097152" />
  </system.web>

我也加了:

<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2097152000" />
      </requestFiltering>
    </security>
  </system.webServer>

但我仍然收到异常 Maximum request length exceeded.。我错过了什么吗?还有什么我可以尝试的吗?

谢谢!

【问题讨论】:

  • 您的 &lt;system.web&gt; 部分设置仍为 2 MB,而在 &lt;system.webServer&gt; 中为 200 MB。
  • @GauravMantri maxRequestLength 以千字节为单位,maxAllowedContentLength 以字节为单位。
  • 您能分享您使用 API 应用上传文件的方法吗?我正在寻找一种方法来最好地利用 Swagger。

标签: c# api azure file-upload azure-api-apps


【解决方案1】:

不幸的是,这还不可能。除了 API 应用程序的限制外,网关也是一个 ASP.NET 应用程序也有限制。您可以更改 API 应用程序,但不能更改网关。

我知道团队正在考虑为此提供解决方案,但我目前没有 ETA 可分享。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-08
    • 1970-01-01
    • 1970-01-01
    • 2015-04-11
    • 2017-04-15
    • 2013-07-01
    • 2016-02-20
    • 2020-11-09
    相关资源
    最近更新 更多