[flexcoders] Re: Can I use mx:Image to load images dynamically from an image.cfm page?

2007-02-13 Thread lepusmars
if you go to umage.cfm in a web browser does the image appear?  Are
you setting the ContentType header on the response correctly?

I've found the Image component to be very difficult to debug myself,
but those are places I would start.

--- In flexcoders@yahoogroups.com, k.hemmen [EMAIL PROTECTED] wrote:

 Our flex developer recently left our company, and I've been given the
 task of resuming work on an enormous project he was involved in. 
 Right now, I'm trying to do something where I display a tile list of
 images depending on the results from a database query returned by a
 call to a method in a CFC.
 
 I've written a coldfusion page called image.cfm that can take a URL
 parameter (the ID of the image from the database), retrieve the file
 from our filesystem, and simulate the content of the image by doing a
 cfcontent to spit out the binary data of the image.  This is
 obviously handy, because I don't need to know the location of any of
 the image files on my fileserver.  I can simply request
 image.cfm?id=12345 and the ColdFusion page will handle the rest,
 returning the image with ID 12345.  This works beautifully on our web
 site.
 
 The problem I'm having now is that I'm trying to implement something
 similar using Flex.  Each time I try, Flex only displays a broken
 image.  As I was trying to figure this out, I broke things down to as
 simple as I could make them.  I created a sample image called
 test.jpg.  I also modified image.cfm so that it only loads test.jpg. 
 When I navigate directly to image.cfm with my web browser
 
 http://myserver.com/image.cfm
 
 It displays the image just exactly as I'd expect it to.  However, when
 I run my Flex application with the following code:
 
 mx:Image x=0 y=0 source=image.cfm/
 mx:Image x=100 y=0 source=test.jpg/
 
 The second mx:Image displays just fine, but the first one does not.
 
 
 Does anyone know if it's possible to do something like this from
 inside Flex?  I'm very new to Flex, but not to development in general.
  I'd appreciate any information you might have.  Thanks!





RE: [flexcoders] Re: Can I use mx:Image to load images dynamically from an image.cfm page?

2007-02-13 Thread Kirk Hemmen
Yes, I'm setting the contenttype header correctly, and when I navigate
to the .cfm file in a web browser the image appears as I expect it to.
When the image is originally uploaded, I'm capturing the image's mime
type and storing it in the database so that I can use it for my
cfcontent when retrieving it for display later.  I've been using a
process similar to this for 3+ years on a website without any problems,
but I want to transfer the same idea to Flex now, and am only getting
broken images.

 

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of lepusmars
Sent: Tuesday, February 13, 2007 12:32 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Can I use mx:Image to load images dynamically
from an image.cfm page?

 

if you go to umage.cfm in a web browser does the image appear? Are
you setting the ContentType header on the response correctly?

I've found the Image component to be very difficult to debug myself,
but those are places I would start.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, k.hemmen [EMAIL PROTECTED] wrote:

 Our flex developer recently left our company, and I've been given the
 task of resuming work on an enormous project he was involved in. 
 Right now, I'm trying to do something where I display a tile list of
 images depending on the results from a database query returned by a
 call to a method in a CFC.
 
 I've written a coldfusion page called image.cfm that can take a URL
 parameter (the ID of the image from the database), retrieve the file
 from our filesystem, and simulate the content of the image by doing a
 cfcontent to spit out the binary data of the image. This is
 obviously handy, because I don't need to know the location of any of
 the image files on my fileserver. I can simply request
 image.cfm?id=12345 and the ColdFusion page will handle the rest,
 returning the image with ID 12345. This works beautifully on our web
 site.
 
 The problem I'm having now is that I'm trying to implement something
 similar using Flex. Each time I try, Flex only displays a broken
 image. As I was trying to figure this out, I broke things down to as
 simple as I could make them. I created a sample image called
 test.jpg. I also modified image.cfm so that it only loads test.jpg. 
 When I navigate directly to image.cfm with my web browser
 
 http://myserver.com/image.cfm http://myserver.com/image.cfm 
 
 It displays the image just exactly as I'd expect it to. However, when
 I run my Flex application with the following code:
 
 mx:Image x=0 y=0 source=image.cfm/
 mx:Image x=100 y=0 source=test.jpg/
 
 The second mx:Image displays just fine, but the first one does not.
 
 
 Does anyone know if it's possible to do something like this from
 inside Flex? I'm very new to Flex, but not to development in general.
 I'd appreciate any information you might have. Thanks!


 



[flexcoders] Re: Can I use mx:Image to load images dynamically from an image.cfm page?

2007-02-13 Thread Doug Lowder
Try using the cfm page's full URL as the source property, just to 
make sure you aren't running into a problem with relative paths.

mx:Image x=0 y=0 source=http://myserver.com/image.cfm/

If that still doesn't work, you can try setting some handlers, 
probably on the ioError event, to see if more information on the 
error condition is available.


--- In flexcoders@yahoogroups.com, k.hemmen [EMAIL PROTECTED] wrote:

 Our flex developer recently left our company, and I've been given 
the
 task of resuming work on an enormous project he was involved in. 
 Right now, I'm trying to do something where I display a tile list 
of
 images depending on the results from a database query returned by a
 call to a method in a CFC.
 
 I've written a coldfusion page called image.cfm that can take a URL
 parameter (the ID of the image from the database), retrieve the 
file
 from our filesystem, and simulate the content of the image by 
doing a
 cfcontent to spit out the binary data of the image.  This is
 obviously handy, because I don't need to know the location of any 
of
 the image files on my fileserver.  I can simply request
 image.cfm?id=12345 and the ColdFusion page will handle the rest,
 returning the image with ID 12345.  This works beautifully on our 
web
 site.
 
 The problem I'm having now is that I'm trying to implement 
something
 similar using Flex.  Each time I try, Flex only displays a broken
 image.  As I was trying to figure this out, I broke things down to 
as
 simple as I could make them.  I created a sample image called
 test.jpg.  I also modified image.cfm so that it only loads 
test.jpg. 
 When I navigate directly to image.cfm with my web browser
 
 http://myserver.com/image.cfm
 
 It displays the image just exactly as I'd expect it to.  However, 
when
 I run my Flex application with the following code:
 
 mx:Image x=0 y=0 source=image.cfm/
 mx:Image x=100 y=0 source=test.jpg/
 
 The second mx:Image displays just fine, but the first one does 
not.
 
 
 Does anyone know if it's possible to do something like this from
 inside Flex?  I'm very new to Flex, but not to development in 
general.
  I'd appreciate any information you might have.  Thanks!