English 中文(简体)
未能从URL下载档案。 该服务器违反了议定书。 第=Response Header Detail=Content-Length头盔值
原标题:Failed to download file from the URL. The server committed a protocol violation. Section=ResponseHeader Detail=Content-Length header value is invalid

在使用台式浏览器时,Im面临从特定URL下载文件的问题,同时完全使用移动装置(Chrome browser)。 我在多个台式浏览器中彻底测试了这一结果,清理了海滩,但我仍然无法说明造成这一问题的原因。

在我点击桌面浏览器链接时,我收到以下错误信息:

発>: 未能从URL下载文件[https://example.com/7075626c6963/SmaPri/Label.spfmtz]。 (服务器违约。) 内容-语文头盔价值

I ve provided the JavaScript code responsible for this action below. The file is downloaded by calling the requestOutput() function. Here s the code:

function requestOutput() {
    var param1 = "__format_archive_url=" + encodeURIComponent( https://example.com/7075626c6963/SmaPri/Label.spfmtz );
    var param2 = "__format_id_number=2";
    var param3 = encodeURIComponent("Z.TanaBango") + "=" + encodeURIComponent("F1-1015") + "&" + encodeURIComponent("Barcode1") + "=" + encodeURIComponent("AXR12452") + "&" + encodeURIComponent("(Print quantity)") + "=" + encodeURIComponent(1);

    var url = "http://localhost:8080/Format/Print?" + param1 + "&" + param2 + "&" + param3;
    transaction(url, ResPrint); 
}

function ResPrint() {
    if (xmlhttp.readyState == 4) {
        if (xmlhttp.status == 200) {
            var xmlDoc = xmlhttp.responseXML;
            var result = xmlDoc.getElementsByTagName( result )[0].childNodes[0].nodeValue;
            var message = xmlDoc.getElementsByTagName( message )[0].childNodes[0].nodeValue;
            if (result == "OK") {
                // OK
            } else {
                // NG
            }
        } else {
            // Error
        }
    }
}

function transaction(url, method) {
    xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = method;
    xmlhttp.open("GET", url, false);
    xmlhttp.send();
}

我在多个浏览器(窗口,ubuntu18.04 LTS)中进行了检测,清理了未工作的海滩。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.