- #1
aheight
- 320
- 108
Hi,
I am storing a blob in my database running wamp64/MySQL and I am using AJAX to retrieve it. The code works with Chrome, Edge, and FireFox but I obtain the error message "Invalid State Error" in the debugger for the line "xmlhttp.responseType='arraybuffer'" when I run it under IE11. I have used FileReader with responseType='blob' to read the blob but get a similar error so I just took out the FileReader. I've googled the error message but could not figure out how to solve the problem. I was wondering if someone could help me get my code to work with IE11. This is my Javascript:
And the PHP code for getImagAlgebraicBlob.php uses PDO and is very simple:
I am storing a blob in my database running wamp64/MySQL and I am using AJAX to retrieve it. The code works with Chrome, Edge, and FireFox but I obtain the error message "Invalid State Error" in the debugger for the line "xmlhttp.responseType='arraybuffer'" when I run it under IE11. I have used FileReader with responseType='blob' to read the blob but get a similar error so I just took out the FileReader. I've googled the error message but could not figure out how to solve the problem. I was wondering if someone could help me get my code to work with IE11. This is my Javascript:
JavaScript:
xmlhttp = new XMLHttpRequest();
xmlhttp.responseType='arraybuffer';
xmlhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
theResponse=this.response;
theBlobSize=theResponse.byteLength;
// start type-casting the blob here
}
}
xmlhttp.open("POST","getImagAlgebraicBlob.php",true);
xmlhttp.send();
And the PHP code for getImagAlgebraicBlob.php uses PDO and is very simple:
PHP:
<?php
include 'algebraicFunctionBlobClass.php';
$blobObj = new algebraicFunctionBlob();
$a = $blobObj->selectImagBlob(132);
echo $a['imagWebGLData'];
?>