嗨,我正在运行这个代码来下载一些响应设置为blob的(4-5) zip文件。这些调用,每次大约5次调用火,如下代码在循环中运行。但是,在一个生产服务器是aws,它返回连接重置在控制台日志后,下载2个文件。有人能突出显示导致此错误的原因吗?我想服务器一次拒绝太多的请求,但不确定。任何帮助都会得到高度认可。谢谢
self.ajax_call_1 = function (url, type, callback) {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.responseType = 'blob';
xhr.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
resolve(xhr.response);
}
}
xhr.open(type, url, true);
xhr.send();
});
}发布于 2018-07-10 09:35:32
在文件上传和AJAX调用中,我也遇到了类似的问题,我使用asp.net服务来上传文件/s。如果您可以访问该服务所在的服务器,如果它是ashx或asmx (asp.net服务)服务,则必须对web.config进行以下更改:
<httpRuntime maxRequestLength="51200" executionTimeout="0"/>在这里-
executionTimeout="6000" Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET. This time-out applies only if the debug attribute in the compilation element is False.
maxRequestLength="102400" for 1mb=1024 so for 100mb=102400httpRuntime进入<system.web>
https://stackoverflow.com/questions/43618129
复制相似问题