Wishlist 0 ¥0.00

IIS WebApi: 文件上传,大小限制,提示413 (Request Entity Too Large)

我想如果有人按照我的标题搜结果,都是在linux系统上解决方案,或者是java。你是不是很绝望。我懂~

若你是C#研发,其实这个问题的解决方向在IIS上,所以你去搜“IIS 设置文件上传大小限制设置方法”,就会有一堆你想要的答案。我就不贴了。

 

net(C#)项目:当你想要上传时,文件过大,报413时,有两种解决方案,这两种解决方案任选其一就可以

一、在web.config上配置,按照以下格式,将下列标红加粗的地方,按照对应位置复制到web.config中,即可解决。

注:这两个标红处均要复制,配置!!!

 
    httpRuntime 中 maxRequestLength就是设置你上传文件的大小限制;
 
    requestLimits 中 maxAllowedContentLength就是设置你上传文件的大小限制;
 
 
<configuration> <system.web> <compilation targetFramework="4.6.1" /> <httpRuntime executionTimeout="600" maxRequestLength="419430400" targetFramework="4.6.1" /> </system.web> <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="419430400" /> </requestFiltering> </security> </system.webServer> </configuration>
 
 

二、IIS中配置

① 打开IIS,找到文件上传的项目,选中->功能试图->配置编辑器(如下图)

1_p67039

 

 ② 修改两处(httpRuntime、requestLimits )

2_p43723

 

 

3_p50694

以上就可以解决文件过大无法上传这个问题。

百度:目前机器翻译准确率已与人类水平相当

12月1日,百度大脑开放日举办。IDC中国副总裁兼首席分析师武连峰表示,到2021年底,超过70%具有海外业务的中国企业将不同程度的采用机器翻译,应用场景也将更为丰富。据介绍,百度提出的语义单元驱动的AI同传模型,翻译准确率为80%,时间延迟约为3秒,与人类水平相当。

页面直接跳转代码


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>5秒后跳转到另一个页面</title>
</head>
<script>
var t = 5;
var s = '.';
timeID=setInterval("countDown()",1000);
function countDown(){
time.innerHTML= t +"秒后跳转"+s;
t--;
s+='.';
if (t==0) {
location.href="http://www.800188.com/"; //【要跳转的网站】
clearInterval(timeID);
}
}
</script>
<body>

<div><font ID="time" face="impact" color="#272822" size="7">即将跳转</font>
</div>
</body>
</html>
 

微信网页授权errcode:48001

errcode":48001,"errmsg":"api unauthorized, hints: [ req_id: 86klWa06252167 ]

原因:

①:你的服务号必须是通过腾讯认证,每年是300元,如果没有认证而导致的错误提示,那就去认证,别往下看了!如果你已认证,本条原因排除,那么请继续往下看

 

②:你是否是第三方网页,第三方网页的话,那么你的url地址里面的scope这个参数要填写"snsapi_userinfo",否则会报这个错!原因如下!

我是用snsapi_base访问的,所以没有出现了这个错误,改用snsapi_userinfo的方式就好了.

原因是snssapi_base静默授权,只能获取openid,获取不了用户其他信息.

snsapi_userinfo需要用户手动同意,才可以获取用户的昵称,头像,地区信息,但是微信号是获取不到的(保护用户隐私,不能随便让人获取哈)。

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.