Re: [flexcoders] JPG delivery via Java-App
On 6/21/05, mummertm [EMAIL PROTECTED] wrote: I have a Java-Servlet or a Java-Class, which retrieves an image (JPG) from a database. As customary this Blob is stored in a byte array (byte []). The Flex-Application connects to the Java application to request the image. My problem is now to find a suitable datatype, which can store binary data in ActionScript. Write a servlet and access it from Flex using its URL. In the servlet, set the content-type of the response to image/jpeg and then just write the binary data to the output stream. See the Gif2JpegServlet class here: http://manish.revise.org/flash/flex/gmap.zip It read from one stream and writes to another. Simple. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] JPG delivery via Java-App
Hi there, I searched a lot of time for a solution of my problem in other forums, documentations an so on. But I didn't find any hint so far, thus you are my last hope. The problem is as follows: I have a Java-Servlet or a Java-Class, which retrieves an image (JPG) from a database. As customary this Blob is stored in a byte array (byte []). The Flex-Application connects to the Java application to request the image. My problem is now to find a suitable datatype, which can store binary data in ActionScript. This means, I need a corresponding data type in ActionScript, which fits to byte[] in Java. Or does possibly anyone know a completely different solution for my problem? Thanks for answers Markus Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] JPG delivery via Java-App
Hi, Macromedia Flash Player doesn't have byte[] or its equivalent data type to store the binary data within AS. But you can load JPEG/SWF files using Loader/Image Flex classes or loadMovie(..) Flash Player API. If I am right, you want to load a JPG image in Flex app right? You can do that using Loader or Image tag mx:Image source=http://server.com/myservlet?imagename=logo; / Image/Loader can load non-progressive JPG and SWF files. -abdul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mummertm Sent: Tuesday, June 21, 2005 2:12 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] JPG delivery via Java-App Hi there, I searched a lot of time for a solution of my problem in other forums, documentations an so on. But I didn't find any hint so far, thus you are my last hope. The problem is as follows: I have a Java-Servlet or a Java-Class, which retrieves an image (JPG) from a database. As customary this Blob is stored in a byte array (byte []). The Flex-Application connects to the Java application to request the image. My problem is now to find a suitable datatype, which can store binary data in ActionScript. This means, I need a corresponding data type in ActionScript, which fits to byte[] in Java. Or does possibly anyone know a completely different solution for my problem? Thanks for answers Markus Yahoo! Groups Links Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] JPG delivery via Java-App
To avoid having to save the image from the database to a physical file as an intermediate step you could try streaming the data from the database directly into the http request of the mx:image tag as Abdul suggests So, 1. Create a java/actionscript VO mapping that includes the image name as a sting. 2. After Flex has received the VO, trigger an event that request the image from the database either via an intermediate physical file save or directly streamed into the http request. Two requests for data instead of one, but it would get you the image. Hope this helps. Regards Ian -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Abdul Qabiz Sent: 21 June 2005 11:57 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] JPG delivery via Java-App Hi, Macromedia Flash Player doesn't have byte[] or its equivalent data type to store the binary data within AS. But you can load JPEG/SWF files using Loader/Image Flex classes or loadMovie(..) Flash Player API. If I am right, you want to load a JPG image in Flex app right? You can do that using Loader or Image tag mx:Image source=http://server.com/myservlet?imagename=logo; / Image/Loader can load non-progressive JPG and SWF files. -abdul -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mummertm Sent: Tuesday, June 21, 2005 2:12 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] JPG delivery via Java-App Hi there, I searched a lot of time for a solution of my problem in other forums, documentations an so on. But I didn't find any hint so far, thus you are my last hope. The problem is as follows: I have a Java-Servlet or a Java-Class, which retrieves an image (JPG) from a database. As customary this Blob is stored in a byte array (byte []). The Flex-Application connects to the Java application to request the image. My problem is now to find a suitable datatype, which can store binary data in ActionScript. This means, I need a corresponding data type in ActionScript, which fits to byte[] in Java. Or does possibly anyone know a completely different solution for my problem? Thanks for answers Markus Yahoo! Groups Links Yahoo! Groups Links This E-mail scanned for viruses by Harlaxton College This E-mail scanned for viruses by Harlaxton College Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/