美文网首页
上传大文件:404 – File or directory no

上传大文件:404 – File or directory no

作者: JADDC | 来源:发表于2018-11-13 16:05 被阅读0次
错误提示
 Server Error
 404 – File or directory not found.
 The resource you are looking for might have been removed, had its name changed, or is                                                        
 temporarily unavailable.
原有配置:可以上传的文件限制已经设置相当大了500MB
   <!--设置最大可上传的文件 和超时时间-->
   <system.web>
     <!--512000 kb = 500mb;6时(h)=21600秒(s)-->
      <httpRuntime maxRequestLength="512000" executionTimeout="21600" appRequestQueueLimit="100" />

<!--executionTimeout:表示允许执行请求的最大时间限制,单位为秒-->
<!--maxRequestLength:指示 ASP.NET 支持的最大文件上载大小。该限制可用于防止因用户将大量文件传递到该服务器而导致的拒绝服务攻击。指定的大小以 KB 为单位。默认值为 4096 KB (4 MB)。-->
<!--appRequestQueueLimit:表示ASP.NET 将为应用程序排队的请求的最大数目。当没有足够的自由线程来处理请求时,将对请求进行排队。当队列超出了该设置中指定的限制时,将通过“503 - 服务器太忙”错误信息拒绝传入的请求。-->
<compilation debug="true" />
   </system.web>

   <!--<system.web>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/>
<httpModules>
  <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
   </system.web>-->
具体问题

IIS 的maxAllowedContent Length的缺省值为30000000 bytes. 上传大于这个长度的数据流被截断,导致文件或目录找不到。

解决办法
 <system.webServer>    
<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2097152000" maxQueryString="5000" maxUrl="8000"></requestLimits>
  </requestFiltering>
</security>
</system.webServer>

相关文章

网友评论

      本文标题:上传大文件:404 – File or directory no

      本文链接:https://www.haomeiwen.com/subject/trdlfqtx.html