I am using the following javascript to upload files to a .Net WCF service.
When using Chrome the onprogress function is called regularly.
When using Edge it only gets called once at the end.
var xhr = new XMLHttpRequest(); xhr.open('POST', '/upload?filename=' + encodeURIComponent(fileToUpload.serverFilename), true); // Listen to the upload progress. xhr.upload.onprogress = function (e) { if (e.lengthComputable) { progress.setValue(e.loaded / e.total); } }; xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { if (onSuccess !== undefined) onSuccess(fileToUpload); } else { Ext.Msg.alert('Upload Error', 'File: ' + fileToUpload.filename + '<br><br>Error: ' + xhr.status + ' ' + xhr.statusText); if (onError !== undefined) onError(); } } }; xhr.ontimeout = function () { console.log('transfer timed out') } var reader = new FileReader(); reader.onload = function () { var arrayBuffer = this.result; xhr.send(arrayBuffer); } reader.readAsArrayBuffer(fileToUpload.file); This behaviour is obviously inconsistent but I would suggest the Edge is not behaving as it should be (there is no point in an onprogress event if it only gets called at the end).
Any workaround? Or have I misunderstood how this is supposed to work (Chrome seems to understand just fine though)?
Or is it a Microsoft bug or non-compliance? And need to wait 10 years to see if they bother to fix it.