Below is an ajax PUT request i use to upload 1 minute video to a server. The file is read by a filereader.
It works fully on Firefox and Edge. It works on Chrome for file size below 106 Mega Byte
BUT it failed for a file of 175 Mega Byte
Here is the request :
$.ajax({
url: urlToS3,
type: 'PUT',
cache: false,
processData: false,
data: reader.result, //video file read using filereader
async: true,
success: fnSuccess,
error: fnError,
crossDomain: true,
contentType: false,
xhr: function() {
xhr = new window.XMLHttpRequest(); //xhr is a global variable
xhr.upload.onprogress = function (evt){fnOnprogress(evt);} ;
xhr.upload.onload = fnOnload;
xhr.upload.onerror = fnOnerror;
return xhr;
},
}, 'json'); //$.ajax({
Tests:
failure on chrome : reader.result.byteLength= 183190491
sucess on chrome reader.result.byteLength= 127838343