当前位置:首页 > Windows程序 > 正文

webapi接口上传大文件

标签:sys   code   mit   config   security   lin   entity   通过   work   

通过WebApi或者MVC模式的接口上传文件时,总数报错

413 Request Entity Too Large IIS

404 服务未找到

解决方法:

技术图片

1. 在web.config文件下找到system.webSever 节点下面增加,maxAllowedContentLenth 文件上传的长度

<security>

<requestFiltering>

<requestLimits maxAllowedContentLength="2147483648"></requestLimits>

</requestFiltering>

</security>

2. 设置上传文件大小

<system.web>

<httpRuntime targetFramework="4.7.2" maxQueryStringLength="1204800" maxUrlLength="1409600" maxRequestLength="67108864" />

</system.web>

webapi接口上传大文件

标签:sys   code   mit   config   security   lin   entity   通过   work   

温馨提示: 本文由杰米博客推荐,转载请保留链接: https://www.jmwww.net/file/14121.html