I have a problem with xmlhttprequest file uploading progress event on Google Chrome for ios6. code already work on all desktop browsers and Safari(ios 6). also there is a problem wiht uploading mov files in google chrome (ios 6), when trying to upload I get file size = 0. Is there any solution for it ?
this is part of my code
var xhr = new XMLHttpRequest();
var eventSource = xhr.upload;
xhr.addEventListener("load", this.onUploadComplete(uploadInfo));
xhr.addEventListener("error", this.onUploadError(uploadInfo));
xhr.addEventListener("abort", this.onUploadAbort(uploadInfo));
// changing Url for preventing ajax call caching( Android , IOS 6)
var ts = Date.now(), rquery = /\?/, rts = /([?&])_=[^&]*/,
ret = uploadUrl.replace( rts, "$1_=" + ts );
uploadUrl = ret + ( ( ret === uploadUrl ) ? ( rquery.test( uploadUrl ) ? "&" : "?" ) + "_=" + ts : "" );
xhr.open('POST', uploadUrl, true);
eventSource.onprogress = this.onUploadProgress(uploadInfo);
xhr.setRequestHeader("Content-Type", "multipart/form-data");
xhr.setRequestHeader('X-FILE-NAME', file.name);
xhr.send(file);