码迷,mamicode.com
首页 > Windows程序 > 详细

webapi接口上传大文件

时间:2019-11-21 17:01:06      阅读:114      评论:0      收藏:0      [点我收藏+]

标签: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.cnblogs.com/smallidea/p/11906414.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!