On Tue, 6 Dec 2005, Ricker, William wrote: > (b) <img > href="/scripts/imagemaker?x=17&y=42&title=%22Foo%20Bar%22&xname=X&yname= > Y"> > Put the code that decides what to do from the Request in a module, and > call it from both the CGI or action module that generates the HTML page > (which generates the <img> link) and the CGI or action module that > generates the dynamic graphic (in response to the <img> link). Some > amount of setup work (varies with app) would have to be redone or saved > in DB or some other place (with unique names!), but at least the code is > reused in a module. In this case, you put all the request parameters > that the graph module needs on the IMG URI, or copy all the request > parms to be safe if you don't know; since it's a module, it should know. > One module, one script could do both Page and Image requests, with a arg > difference (or HTTP context wanting text/html or image/*?) determining > which to generate.
If you opt for this solution, I strongly recommend not trying to pass serialized data to the script. Instead, store the data somewhere else and give the script the means to look up the data. Otherwise, it is quite likely, given arbitrary amounts of data, that you will find that your URL exceeds 2048 characters, which happens to be the maximum length of a URL in IE. Personally I prefer to just generate a temporary file if I have to store something temporarily (the data or the image). Here I am creating a file in a temporary directory, giving it a name with the datetime and generating module (useful for any developer who is looking at files), and a random string. Thius is quite adequate for our purposes, but of course it isn't suitable for all situations. I have an hourly cron job deleting all files in that directory which are older than one hour. - Ann _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

