I'm working on a project that requires me to extract images and sounds stored in database and serve to browser.
The images and sounds are stored in the BLOB format and i'm able to retrieve the byte arrays respectively.
I'm trying to send these byte arrays to flex(3) through an HTTP service. However i'm not able to recieve the byte arrays and frankly not sure if this is the right way to do this.
Here are more application specific information
xyz.jsp file has a tag that calls a function from a java class that reads the database
abc.getData() returns a string(generated of the byte of the BLOB data items) and in the flex mxml file i use http request as follows
<mx:HTTPService id="req" url="xyz.jsp" method="POST" resultFormat="e4x" result="rec()"></mx:HTTPService>
and the rec() function has the command to read info like
var str:String = req.lastRequest.data
Everything as far as the syntax is concerned is fine, i say this because if i read some other data form the <data> tag i get the output. I'm thinking there is some issue with sending raw binary information like this.
Any kinda help to solve the problem is appreciated
Thanks and warm regards
Thx 4 d reply , yup i hav seen that blog and hav tried implementing it , however the issue i have mentioned is not converting byte array to image its rather gettin the byte array in the first place. I can use dat blog only wen i hav a valid byte array rite? so it wud be helpful if u help me extract the BLOB from database into a byte array in flex. There are some links i get which uses PHP to do dis but unfortunately i gotta use JSP n i am not able to find a rite way to proceed.
Thx in advance and cheers
You should use URLLoader.. get the data in bytestream. Or in the httpService use the resultformat as something else whch can gt the data in bytestream.