When uploading a file using multipart/form-data enc type, firing an async xmlhttp request the onreadystate does not go beyond 1 (in a rage of 1-4). As a result no asyc xmlhttp requests can be made while a file upload is taking place (thus no progress information can be got from the server asynchronously.
Making an xmlhttp synchronous request works as excepted.
This works in all IE and Firefox versions that support AJAX.
Do you have an example of this problem? It's not clear what you mean by file upload - is it form submission?
(In reply to comment #1)
> Do you have an example of this problem? It's not clear what you mean by file
> upload - is it form submission?
Uploading a file using a form with enc-type set to multipart/form-data. Don't know how else to explain this. I'm uploading a file.
So essentially, while I'm uploading a file (that is the file upload is in progress, I'm trying to make an asyc xmlHttp request. This does not work as expected (as explained previously). All this does work in other browsers. The synchronous version does work here as well but the async version does not work.
Thanks! This is the same as bug 23933, which was filed later, but has somewhat more detail and a test case, so I'll mark this as a duplicate.
A workaround in your case is to use XMLHttpRequest file upload instead of form submission. This is not supported in any Safari release yet, but is supported in Safari 4 beta. Untested pseudo-code:
var fileInputElement = ...
var file = fileInputElement.files; // multiple files in one input element are supported
var req = new XMLHttpRequest;
*** This bug has been marked as a duplicate of 23933 ***