javascript - How to display progress info on console for video-uploading on S3? -
i uploading video on s3 bucket , see progress bar. coded :
reader.onload = function (e) { var rawdata = reader.result; $.ajax({ url: s3url, type: 'put', cache: false, processdata: false, data: rawdata , async: false, success: fnsuccess, error: fnerror, crossdomain: true, contenttype: "binary/octet-stream", xhr: function() { console.log("xhr"); var xhr = new window.xmlhttprequest(); xhr.upload.addeventlistener("progress", function(evt) { if (evt.lengthcomputable) { var percentcomplete = evt.loaded / evt.total; console.log(percentcomplete); } }, false); return xhr; }, }, 'json'); //$.ajax({ }; //reader.onload = function
but percent not displayed in console.log. idea ?
xhr
should $.ajaxsettings.xhr()
instead of new instance of xmlhttprequest()
see upload multiple image using ajax, php , jquery
Comments
Post a Comment