Using XML RPC, I am fetching a generated chart (PNG) and its image map from a PHP server. The question is, now how do I display both the chart (base 64 data) and the image map (HTML)? If I make the action display the chart with "send_data", then the image map HTML gets lost. If I insert the image map HTML into the corresponding view, then the chart gets lost. The only options I could think of were: 1. stick the chart in the session; have the view make a call to a second rails action in which the chart is pulled from the session and displayed with send_data 2. write the chart to a file with a unique name somewhere in the document root; insert an <img> tag in the view that references this chart I didn''t like either solution: #1 seemed messy to maintain if I am displaying a lot of charts. #2 seemed messy having a lot of temp files lying around; it also potentially exposes private data to other users. Has anyone needed to do anything like this and have a better suggestion? thanks, Jeff
François Beausoleil
2005-Aug-26 01:43 UTC
Re: how to display both a generated image and its image map
Hello Jeff, Jeff Cole said the following on 2005-08-25 18:57:> Has anyone needed to do anything like this and have a better suggestion?I don''t remember off-hand where I saw that, but there is a way to encode the image data in the img tag somehow. Search the web, or maybe someone will remember how to do that. If I remember correctly that was to be used in E-Mail, to prevent having to download offline content. Bye, François