1 Reply Latest reply on Feb 12, 2009 2:56 PM by plug_in_guy

    retrieving binary mySQL data?

      I am having difficulty retrieving "binary data" from a mySQL database with my Flex program. The image data was inserted into the database by another programmer who preprocessed the data and removed all the zeros, by using the byte value of 1 as an escape sequence. So the data can be handled as strings by the mySQL calls he used to insert it. However, when I connect to the database and call .execute() and .getResult(), the only way (I know of) to get the data is:

      var imageData:String = result.data[0].data;

      and by then, the data has already been changed because Flex does some unknown processing of the data to make it into a String. Does anyone know how to avoid the String processing and obtain the database data directly? I've tried:

      var bytes:ByteArray = new ByteArray();
      bytes.writeMultiByte (imageData,"us-ascii");
      bytes.position = 0;

      but again, it is too late, the data in imagedata is already been somewhat clobbered by obtaining it as a String.