首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >文件下载xmlhttprequest中的ERR连接重置

文件下载xmlhttprequest中的ERR连接重置
EN

Stack Overflow用户
提问于 2017-04-25 18:14:42
回答 1查看 1.4K关注 0票数 0

嗨,我正在运行这个代码来下载一些响应设置为blob的(4-5) zip文件。这些调用,每次大约5次调用火,如下代码在循环中运行。但是,在一个生产服务器是aws,它返回连接重置在控制台日志后,下载2个文件。有人能突出显示导致此错误的原因吗?我想服务器一次拒绝太多的请求,但不确定。任何帮助都会得到高度认可。谢谢

代码语言:javascript
复制
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();
    });
}
EN

回答 1

Stack Overflow用户

发布于 2018-07-10 09:35:32

在文件上传和AJAX调用中,我也遇到了类似的问题,我使用asp.net服务来上传文件/s。如果您可以访问该服务所在的服务器,如果它是ashx或asmx (asp.net服务)服务,则必须对web.config进行以下更改:

代码语言:javascript
复制
<httpRuntime maxRequestLength="51200" executionTimeout="0"/>

在这里-

代码语言:javascript
复制
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=102400

httpRuntime进入<system.web>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43618129

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档