rashley has asked for the wisdom of the Perl Monks concerning the following question:
Currently, I SFTP the file from the web server to the pubs server and redirect the client as such:
Now, for security reasons, I can no longer let the client communicate directly to the pubs server, so everything has to go through the web server in the DMZ.my $redirectURL = 'http://'. $destination_server . '/cgi-bin/pubtools +/ebom.' . $extension . '?XML=' . $randomName; + ## copy our XML to the correct location/filename $logger->info("Report requested, FTP $localfile to $destination_server +"); my $ftp = Net::SFTP->new($destination_server, Debug=>0); $ftp->login($login, $pass) or $logger->error("Could not connect to Pub +s Server"); $ftp->cwd($destination_path) or $logger->error("Could not change direc +tories on Pubs Server"); $ftp->put($localfile, $randomName) or $logger->error("Could not transf +er file to Pubs Server"); $ftp->site('chmod','0666',$randomName) or $logger->error("Could not ch +mod remote file"); $ftp->quit; + ## Now we redirect them to the generated PDF + $logger->info("Redirecting to $redirectURL"); + print $cgi->redirect(-target => 'ResultWindow', -expires => 'now', -ur +i=>$redirectURL);
So instead of redirecting, I need to call this URL directly from the server and stream the data back to the browser. Any idea of how to do this? Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Streaming data through web server to browser with CGI
by moritz (Cardinal) on Aug 15, 2007 at 20:33 UTC | |
by rashley (Scribe) on Aug 16, 2007 at 12:07 UTC | |
|
Re: Streaming data through web server to browser with CGI
by rashley (Scribe) on Aug 16, 2007 at 15:29 UTC | |
by moritz (Cardinal) on Aug 16, 2007 at 15:32 UTC | |
by rashley (Scribe) on Aug 16, 2007 at 15:40 UTC | |
by jZed (Prior) on Aug 16, 2007 at 15:48 UTC | |
by rashley (Scribe) on Aug 16, 2007 at 15:55 UTC |