CFImage and WriteToBrowser

2008-06-13 Thread CFDEV
I am using CFIMAGE to read CLOB data from an oracle database and then write
it to the browser for the end user to view.
My thought was that the "writetobrowser" attribute will be creating an
instance in memory therefore the file is not written to the file server.

is this true?

If so, after the image is displayed in the web browser, by viewing the
properties of the image, it is shown as:
/CFFileServlet/_cf_image/_cfimg[xx]

Am I correct in assuming that the file is being written to the file server
within that area and then viewed by the browser?
As well, how long does the CF Server maintain the image (just for the
request or is it there until the server restarts)?

Now to throw another monkey wrench into the whole schema
How effective is this within a Load Balancing configuration?
Is the image generated on SERVER A and then the request is moved to SERVER B
for the remaining requests (all one single web transaction),
and then the image is no longer viewable since the end user is now on SERVER
B but the image is on SERVER A?

Our goal is to display the images from the database without the need to
write them to the file server and run a cleanup process afterwards..


-- 
Fred Allen  - "Imitation is the sincerest form of television."


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307405
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CFImage and WriteToBrowser

2008-06-13 Thread Dave Watts
> I am using CFIMAGE to read CLOB data from an oracle database 
> and then write it to the browser for the end user to view.
> My thought was that the "writetobrowser" attribute will be 
> creating an instance in memory therefore the file is not 
> written to the file server.
> 
> is this true?
> 
> If so, after the image is displayed in the web browser, by 
> viewing the properties of the image, it is shown as:
> /CFFileServlet/_cf_image/_cfimg[xx]
> 
> Am I correct in assuming that the file is being written to 
> the file server within that area and then viewed by the browser?
> As well, how long does the CF Server maintain the image (just 
> for the request or is it there until the server restarts)?

That URL pattern doesn't point to an actual physical filesystem location.
That said, I don't know if there's a file being written somewhere or not.

> Now to throw another monkey wrench into the whole schema
> How effective is this within a Load Balancing configuration?
> Is the image generated on SERVER A and then the request is 
> moved to SERVER B for the remaining requests (all one single 
> web transaction), and then the image is no longer viewable 
> since the end user is now on SERVER B but the image is on SERVER A?

Whether it creates an image in memory or on the filesystem, it won't work in
a fully load-balanced environment. The user will have to view the image on
the server that generated it. If you're using sticky sessions on your load
balancer, it'll work.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307413
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CFImage and WriteToBrowser

2008-06-13 Thread Brad Wood
If you look in your web.xml file (on a Mulit-server install it's
"/
servers\instance_name\cfusion-ear\cfusion-war\WEB-INF\web.xml" you will
see the following servlet mapping:


  CFFileServlet 
  /CFFileServlet/* 
 

The url pattern tells JRUN that any request that comes through that
looks like www.your-server.com/CFFileServlet/* will be handled by the
CFFileServlet.  

Elsewhere in your web.xml is the following:

  CFFileServlet 
  Serves files for cfpresentation,cfreport,captcha
etc 
  coldfusion.bootstrap.BootstrapServlet 
 
  servlet.class 
  coldfusion.util.CFFileServlet 
  


This defines what Class is used to process that request.  My assumption
is the file is probably stored in memory and then spit out with the
appropriate content type header when your browser asks for the image.

That might be more info that you cared to know, but I thought that was
pretty dang cool once I realized how ColdFusion processes your
requests... especially requests for non-existent folders.

~Brad

> If so, after the image is displayed in the web browser, by 
> viewing the properties of the image, it is shown as:
> /CFFileServlet/_cf_image/_cfimg[xx]
> 
That URL pattern doesn't point to an actual physical filesystem
location.
That said, I don't know if there's a file being written somewhere or
not.

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307417
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFImage and WriteToBrowser

2008-06-16 Thread Jochem van Dieten
CFDEV wrote:
> I am using CFIMAGE to read CLOB data from an oracle database and then write
> it to the browser for the end user to view.
> My thought was that the "writetobrowser" attribute will be creating an
> instance in memory therefore the file is not written to the file server.
> 
> is this true?

No.


> If so, after the image is displayed in the web browser, by viewing the
> properties of the image, it is shown as:
> /CFFileServlet/_cf_image/_cfimg[xx]
> 
> Am I correct in assuming that the file is being written to the file server
> within that area and then viewed by the browser?

It isn't written to the file server, it is written to the cfusion 
server, to the /WEB-INF/cfusion/tmpCache/ directory.


> As well, how long does the CF Server maintain the image (just for the
> request or is it there until the server restarts)?

It is removed after a while by an internal scheduled task.


> Now to throw another monkey wrench into the whole schema
> How effective is this within a Load Balancing configuration?
> Is the image generated on SERVER A and then the request is moved to SERVER B
> for the remaining requests (all one single web transaction),
> and then the image is no longer viewable since the end user is now on SERVER
> B but the image is on SERVER A?

The image will not be viewable if the request for the image is directed 
to another CF instance. The only way to solve that currently is to use 
sticky sessions. (http://adobe.com/go/wish/ to make the cache location 
configurable just as it is for cfchart.)
All tags that require 2 or more subsequent HTTP request have this problem.


> Our goal is to display the images from the database without the need to
> write them to the file server and run a cleanup process afterwards..

Are you concerned with performance or complexity? The solution builtin 
to CF does not solve the performance issues with writing / deleting, but 
it does solve the complexity problem.

Jochem

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307553
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4