in reply to Re: Images built on the fly do not display
in thread Images built on the fly do not display
We did try to give the give the process ID as the filename.
Yes, I can see how it would be a good idea to send the image directly to the browser but I am curious to know why the current effort doesn't work Here is the full code:
#!/usr/bin/perl -w $|=1; use strict; use CGI::Carp "fatalsToBrowser"; use CGI ":all"; use DBI; print header,start_html(-title=>'Bright', -bgcolor=>'#BDBDB0'); print h1(font{-face=>'Futura Lt BT'}, "Genome view"); print font{-size=>'3', -color=>'#800000', -face=>'Futura Lt BT'}; my($tth,$sth,$dbh,@position,$start,$finish,@row,$i,$child_pid,@accessi +on,$SQLstr,$imagename); if(!param) { $dbh = DBI->connect("DBI:mysql:database=dicty;host=localhost", "** +**", "****"); $sth=$dbh->prepare("select min(fstart),max(fstop) from fdata"); $sth->execute; while(@row=$sth->fetchrow_array) { $position[0]=$row[0]; $position[1]=$row[1]; } $dbh->disconnect; print start_form; print textfield(-name=>'start',-value=>$position[0],-size=>15),br, textfield(-name=>'finish',-value=>$position[1],-size=>15); print submit(-name=>'submit'),end_form; } if(param("submit")) { $imagename=$$; $start=param("start"); $finish=param("finish"); if(!defined($child_pid=fork())) { die "cannot fork $!"; } elsif($child_pid==0) { my $query= "/usr/apache/cgi-bin/order/ldasdump.pl -png -d dict +y chr5.1:$start,$finish --user root --pass mysqladmin > /usr/apache/h +tdocs/imagename.png"; exec($query); } else { waitpid($child_pid,0); print img({src=>"../../imagename.png",align=>'LEFT'}); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Images built on the fly do not display
by dws (Chancellor) on Jan 08, 2003 at 11:53 UTC | |
by bart (Canon) on Jan 08, 2003 at 12:02 UTC | |
by nosbod (Scribe) on Jan 08, 2003 at 13:50 UTC | |
by nosbod (Scribe) on Jan 08, 2003 at 12:57 UTC |