I have a controller method that gathers stats to be used to create a
graph image. I'm trying to track down whatever is corrupting it,
though, because I can't get it to show up.The very same code works for
the old site (same server). When I compare the wget output of two, I
see that the Cake version (linux file utility says it's simply "data")
is about 1K larger. So, it seems that Cake is doing something to it.
But I can't figure out what else I can doi besides setting the $layout
to null and debug to 0.
My view has:

<img src="/panels/graphSales.png"
        style="display: block;width: 700px; height: 300px; margin: 40px auto;"
        alt="graph of sales" />

The controller:

var $helpers = Array('Graph');

function graphSales()
{
        $this->layout = null;
        $this->autoLayout = false;
        Configure::write('debug', 0);
        
        // stuff to get the data ...

        $this->set('data', $data);
}

The view:

<?= $graph->makeLineGraph($data) ?>

The $graph helper's makeLineGraph() is precisely the same code used
for the old site. It finishes by setting the proper headers and
calling ImagePNG().

The headers I'm seeing are:
-- snip --
Date: Thu, 03 Apr 2008 04:08:21 GMT
Server: Apache/2.2.6 (Fedora)
X-Powered-By: PHP/5.2.4
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Expires: Tue, 2 Jul 1974 17:41:00 GMT
Last-Modified: Thu, 03 Apr 2008 04:08:22 GMT
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
content-disposition: inline; filename = "index.png"
Connection: close
Transfer-Encoding: chunked
Content-Type: image/png

200 OK
-- snip --

Note the filename. The script on the old site emits "graph_sales.png".
This appears to validate my presumption that the fact that everything
is dispatched through webroot/index.php is causing this problem. But I
obviously can't go around all that and hit the controller directly.

I've been trawling the net, looking at what few examples I could find
(outputing CAPTCHAs, thumbnails, etc.) but nothing's jumped out at me.
I can't figure out what else to do to have cake simply let the data go
out without touching it.

I'm stymied by this. Anyone have any ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to