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);
This is a known bug for Chrome on iOS, it doesn't support progress update. More details here: https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support
Also, I have reported the bug to the official bug tracker, you can see the latest updates here
UPDATE 2016: It has been fixed!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With