Arkady Grudzinsky wrote:
Hi,

This is not really a cgiapp-specific question, but the
answer may be short and nobody will get hurt if I ask it.

I have a statistical data analysis application generating
plots dynamically from data stored in a data base. The
plots are inserted into HTML pages using a dynamically-generated <img src=plot.cgi?prm=1;prm=2;prm=3...> tag. The list of
parameters may be very long.


The long plot URL presents a problem in IE browser which,
apparently, chops URL's to 2048 characters causing plot.cgi
script to crash.  This IE behavior is, of course,
undocumented and there is no option in browser configuration
to override that.  Mozilla does not have this limitation
(why should it?).
Ahh, the joys of IE.


There is no problem when parameters are submitted using POST
method through forms, but if I want to show the plot in
HTML, I have to provide plot URL, don't I?

I consider the following solutions:

1. Detect when the URL is too long and place a submit button
instead of the <img> tag.  The obvious inconvenience is that
the image will be displayed by itself on a separate page and
the user will have to click "Back" to return to the plot
options.

2. Find a way to submit parameters for the image using POST
method and still show it in HTML. Can I do that? Should I
use JavaScript for that? I have not used JavaScript yet.


Another problem is that the image is generated by a second
HTTP request and requires to run a separate script slowing
down the application. Is there a way to insert an image
DIRECTLY into HTML (I mean the actual PNG file, not the
image URL)?

I think I might attack this problem like this. I assume you get some information from the user (using a form) in order to get the information for the points to plot, right?


When that data is submitted to the backend script, process it and generate the image you need. Take the incoming parameters and create an MD5 hash key from those parameters. Name the image with that hash key. Return a page to the user where the name of the image refers to the hash key. If you need to image to be user specific, not just parameter specific, you can add the session key to the parameters when creating the MD5 hash.

If you think someone would submit those params again you can leave the image. If you think that is unlikely and you will run out of disk space you could have a cron job that would clean it up, or you could even have you application delete images that are too old (as you define) when you create your next image. This might impact performance a little if you are generating a lot of images.

Any thing in that mess help?

Michael Peters
Developer
Plus Three

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to