Is your question
a) how to get the byteArray into flex?
b) how to display it once it is in flex?
c) both a and b ?

I can help you with b !

-----Original Message-----
From: [email protected] on behalf of txakin
Sent: Fri 11/04/2008 14:29
To: [email protected]
Subject: [flexcoders] How to download a BLOB from database....using Java
 
Hi all....

I would like to know...how to download a BLOB (image, file...binary 
data) from my Oralce database to my Flex application.

I think i already have my servlet created....the souce can be more 
or less like the next one:

Session session = HibernateSessionFactory.getSession();

//Here i get my POJO (my movieImage object)
MovieImage myMovieImage = (MovieImage)session.load(MovieImage.class, 
movieId);

//I got the binary data (in this case one image), into array of bytes
byte[] myCover = myMovieImage.getCover();
ServletOutputStream servletOutputStream = res.getOutputStream();
res.setContentType("application/image");
res.setContentLength(myCover.length);
servletOutputStream.write(myCover, 0, myCover.length);
servletOutputStream.flush();
servletOutputStream.close();


But my problem is how to show that image in my component....

Can someone help me (with some source or with some steps or some 
example) to get the solution?

Thansk in advance.



______________________________________________________________________
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
______________________________________________________________________

<<winmail.dat>>

Reply via email to