#! /usr/bin/perl # # Purpose: # FlowViewer_Save.cgi controls the moving of a temporary copy of the # FlowViewer and FlowGrapher HTML files and the FlowGrapher graph image # file to either the FlowViewer or FlowGrapher htdocs directory. This # is to save these files for later use. # # Description: # # Input arguments (received from the form): # Name Description # ----------------------------------------------------------------------- # save_filename Name of temp file created by FlowViewer or FlowGrapher # # Modification history: # Author Date Vers. Description # ----------------------------------------------------------------------- # J. Loiacono 07/04/2005 1.0 Original version. # J. Loiacono 01/01/2006 1.0 Updated for FlowGrapher # J. Loiacono 12/25/2006 3.1 [No changes to this module] # J. Loiacono 02/14/2007 3.2 [No changes to this module] # #$Author$ #$Date$ #$Header$ # ########################################################################### # # BEGIN EXECUTABLE STATEMENTS # use FlowViewer_Configuration; use FlowViewer_Utilities; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $FORM{$name} = $value; } $save_filename = $FORM{'save_filename'}; $save_filename =~ s/Save as: //; # (Micro$loth!) if ($save_filename =~ /graph/) { $move_command = "mv $work_directory/$save_filename $graphs_directory/$save_filename"; system($move_command); $saved_page = "$FlowViewer_service://$FlowViewer_server$graphs_short/$save_filename"; } elsif ($save_filename ne "") { $move_command = "mv $work_directory/$save_filename $reports_directory/$save_filename"; system($move_command); $saved_page = "$FlowViewer_service://$FlowViewer_server$reports_short/$save_filename"; } print "Content-type:text/html\n\n"; print ""; print ""; print ""; print ""; print "Save FlowViewer or FlowGrapher";