J
Jason Morehouse
Hello,
Anyone know if it's possible to speak with the server via xmlhttp.open
while the browser is doing a post -- file upload in this case:
<form enctype="multipart/form-data" action="product" method="post"
name="product" onSubmit="do_action_form(); return true;">
....
<script>
// .. setup xmlhttp here.
function do_action_form() {
xmlhttp.open("GET", '/upload?file_id=173729929292')
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
alert(xmlhttp.responseText);
}
}
xmlhttp.send(null);
}
</script>
This code works fine if not being using during a (browser) post, but
dies with:
Error: [Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame ::
upload/file_id=42442662626 :: anonymous :: line 356" data: no]
The purpose of this is to check the file upload status (eta / size etc)
with the server as a file is being uploaded.
Thanks,
-J
Anyone know if it's possible to speak with the server via xmlhttp.open
while the browser is doing a post -- file upload in this case:
<form enctype="multipart/form-data" action="product" method="post"
name="product" onSubmit="do_action_form(); return true;">
....
<script>
// .. setup xmlhttp here.
function do_action_form() {
xmlhttp.open("GET", '/upload?file_id=173729929292')
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
alert(xmlhttp.responseText);
}
}
xmlhttp.send(null);
}
</script>
This code works fine if not being using during a (browser) post, but
dies with:
Error: [Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame ::
upload/file_id=42442662626 :: anonymous :: line 356" data: no]
The purpose of this is to check the file upload status (eta / size etc)
with the server as a file is being uploaded.
Thanks,
-J