This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

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

  • 1 balasan
  • 1 ada masalah ini
  • 1 paparan
  • Balasan terakhir oleh 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

Diubah oleh mhollmann

All Replies (1)

more options