搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Problem with XHR POST large BLOBs (since version 67.0b3 - Firefox only)

  • 1 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 cor-el

more options

Hi all,

I built a small web application that can extract a large zip file (around 275MB) and sends a specfic large file of the extracted contents (around 300MB) via POST request to my own web api. To do so I use the libary "zip.js". At first everything worked fine in all common browsers (Opera, Chrome, IE, Edge and Firefox) under different plattforms (linux and windows).

But since the release of version 67.0 of Firefox it didn't work anymore. I already watched the packages via wireshark. Firefox sends the header of the request but does not attach the file itself.

I already tested my web application with first available beta version of 67 (67.0b3) and latest nightly version (69.0a1) but they didn't work either. The latest runnable version was 66.0.5.


Javascript Code:

function uploadFile(fileAsBlob) {

    console.log(fileAsBlob);
    const xhr = new XMLHttpRequest();
    if (xhr.upload) {
           xhr.onreadystatechange = function() {
               if (xhr.readyState === 4) {
                   if (xhr.status !== 200) {
                       console.log("Error while uploading.");
                       return;
                   }
                   console.log('Successful.');
               }
           };
           xhr.onerror = function() {
               console.log(xhr);
           };
           xhr.ontimeout = function() {
               console.log(xhr);
           };
           xhr.open("POST", 'myEndpoint123', true);
           xhr.setRequestHeader("X_FILENAME", "myFile.xxx");
           xhr.send(fileAsBlob);
    }

}


The corresponding output in the developer console was not helpful for me:

Blob size: 299148800 type: "" <prototype>: BlobPrototype constructor: function () size: slice: function slice() type: <get size()>: function size() <get type()>: function type() <prototype>: Object { … } 169.254.153.110:325:17

Error while uploading. 169.254.153.110:332:33

XMLHttpRequest​ mozAnon: false​ mozSystem: false onabort: null onerror: function onerror() onload: null onloadend: null onloadstart: null onprogress: null onreadystatechange: function onreadystatechange()​ ontimeout: function ontimeout() readyState: 4 response: "" responseText: "" responseType: "" responseURL: "" responseXML: null status: 0 statusText: "" timeout: 0 upload: XMLHttpRequestUpload { onloadstart: null, onprogress: null, onabort: null, … } withCredentials: false <prototype>: XMLHttpRequestPrototype { open: open(), setRequestHeader: setRequestHeader(), send: send(), … }

169.254.153.110:339:25



When I run the same code with another browser (here Google Chrome), I got the following output:

Blob  {size: 299148800, type: ""} size: 299148800 type: "" __proto__: Blob size: (...) slice: ƒ slice() type: (...) constructor: ƒ Blob() Symbol(Symbol.toStringTag): "Blob" get size: ƒ size() get type: ƒ type() __proto__: Object (index):325

Successful. (index):335



Has somebody an idea what could be the reason for this behavior? And maybe how it could be fixed?


Best regards Marvin

Hi all, I built a small web application that can extract a large zip file (around 275MB) and sends a specfic large file of the extracted contents (around 300MB) via POST request to my own web api. To do so I use the libary "zip.js". At first everything worked fine in all common browsers (Opera, Chrome, IE, Edge and Firefox) under different plattforms (linux and windows). But since the release of version 67.0 of Firefox it didn't work anymore. I already watched the packages via wireshark. Firefox sends the header of the request but does not attach the file itself. I already tested my web application with first available beta version of 67 (67.0b3) and latest nightly version (69.0a1) but they didn't work either. The latest runnable version was 66.0.5. Javascript Code: function uploadFile(fileAsBlob) { console.log(fileAsBlob); const xhr = new XMLHttpRequest(); if (xhr.upload) { xhr.onreadystatechange = function() { if (xhr.readyState === 4) { if (xhr.status !== 200) { console.log("Error while uploading."); return; } console.log('Successful.'); } }; xhr.onerror = function() { console.log(xhr); }; xhr.ontimeout = function() { console.log(xhr); }; xhr.open("POST", 'myEndpoint123', true); xhr.setRequestHeader("X_FILENAME", "myFile.xxx"); xhr.send(fileAsBlob); } } The corresponding output in the developer console was not helpful for me: Blob size: 299148800 type: "" <prototype>: BlobPrototype constructor: function () size: slice: function slice() type: <get size()>: function size() <get type()>: function type() <prototype>: Object { … } 169.254.153.110:325:17 Error while uploading. 169.254.153.110:332:33 XMLHttpRequest​ mozAnon: false​ mozSystem: false onabort: null onerror: function onerror() onload: null onloadend: null onloadstart: null onprogress: null onreadystatechange: function onreadystatechange()​ ontimeout: function ontimeout() readyState: 4 response: "" responseText: "" responseType: "" responseURL: "" responseXML: null status: 0 statusText: "" timeout: 0 upload: XMLHttpRequestUpload { onloadstart: null, onprogress: null, onabort: null, … } withCredentials: false <prototype>: XMLHttpRequestPrototype { open: open(), setRequestHeader: setRequestHeader(), send: send(), … } 169.254.153.110:339:25 When I run the same code with another browser (here Google Chrome), I got the following output: Blob  {size: 299148800, type: ""} size: 299148800 type: "" __proto__: Blob size: (...) slice: ƒ slice() type: (...) constructor: ƒ Blob() Symbol(Symbol.toStringTag): "Blob" get size: ƒ size() get type: ƒ type() __proto__: Object (index):325 Successful. (index):335 Has somebody an idea what could be the reason for this behavior? And maybe how it could be fixed? Best regards Marvin

由mhollmann于修改

所有回复 (1)

more options