How to read data from binary "database" files to present on the web page?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PO Eriksson
    New Member
    • Mar 2011
    • 2

    How to read data from binary "database" files to present on the web page?

    Have tried this and it works for Textstring,
    objXml.response Text, but I can't get it to work for binary array, objXml.response Body.
    Code:
    <HTML><HEAD>
    <SCRIPT language = "Javascript">
    objXml = new ActiveXObject("Microsoft.XMLHTTP");
    var datafile = "data.txt";
    objXml.open("GET", datafile, true);
    objXml.onreadystatechange=function() {
       if (objXml.readyState==4) {
           display(objXml.responseBody);
      }
     }
    objXml.send(null);
    function display(input) {
      alert(input);
    }
    </SCRIPT>
    <BODY></BODY>
    </HTML>
    Last edited by Dormilich; Mar 16 '11, 01:17 PM. Reason: spelling corrected
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    MSDN states that you at least need MSXML 2.0 to use responseBody. not sure if that is supported in your case. various post over the net indicate, that you can’t use a binary bytestream in JScript, solutions commonly used a binary to string transcription through VBScript.
    Last edited by Dormilich; Mar 16 '11, 01:26 PM.

    Comment

    • PO Eriksson
      New Member
      • Mar 2011
      • 2

      #3
      It seams as I get in something since I do not get it as "undefined" . If that's true I might only need to convert it to a variant someway.

      Comment

      Working...