问题描述:通过WebApi上传文件时,提示:读取 MIME 多节正文部分时出错。
问题原因:Http请求传输文件大小超过限制。
解决办法:
再WebApi的Web.config中配置如下内容:
<system.web>
   <!--允许请求长度,设置为1GB内容-->
   <httpRuntime targetFramework="4.5.1" maxRequestLength="1073741824" />
</system.web>
<system.webServer>
    <security>
      <requestFiltering>
        <!--最大允许请求长度,单位byte,当前限制为1G-->
        <requestLimits maxAllowedContentLength="1073741824"></requestLimits>
      </requestFiltering>
    </security>
</system.webServer>
                    