hi,
I am trying to create a web application where i have a form to upload a file,which is then processed by a cgi script and gives me out the output,
here is the code which i use,
the problem is when i see the error log it says the
" malformed header from script. Bad header=COMPND Y 2p-DEOXY-N6-(S)STYR: /Users/gunasekp/Sites/cgi-bin/automate_cgi.pl
sh: line 1: /Users/gunasekp/web_server/Output/query.alm: Permission denied
sh: line 1: /Users/gunasekp/web_server/Output/distances_SH.lo g: Permission denied "
2)(pdb2alm and command_....) are executable c++ files which are placed in a directory in harddisk and whose configuration is (drwxr-xr-x and for files -rwxrwxrwx)
3) the output files like query.alm are written to directory whose configuration is (drwxrwxrwx and for files -rw-r--r--)
help me to solve this problems?
Prasad.
I am trying to create a web application where i have a form to upload a file,which is then processed by a cgi script and gives me out the output,
here is the code which i use,
Code:
# Configuration
my $EXECUTABLE_DIRECTORY = "/web_server/Test";
my $CREATE_DIRECTORY = "//web_server/Output";
my $cgi = CGI->new();
my $pdb_file = $cgi->param("upfile");
$pdb_file =~ s/.*[\/\\](.*)/$1/;
die "Missing PDB file \n" if(!$pdb_file);
print STDERR "PDB file is $pdb_file\n";
my $mode = 'SH';
my $read_file = $cgi->upload("upfile");
open (UPFILE,">$CREATE_DIRECTORY/$pdb_file");
while ( <$pdb_file> ) {
print UPFILE;
print ;
}
close UPFILE;
if ($mode eq 'SH'){
system "$EXECUTABLE_DIRECTORY/pdb2alm $CREATE_DIRECTORY/$pdb_file > $CREATE_DIRECTORY/query.alm";
system "$EXECUTABLE_DIRECTORY/command_arg_alm_exp $CREATE_DIRECTORY/query.alm > $CREATE_DIRECTORY/distances_SH.log" ;
open(IN,"<$CREATE_DIRECTORY/distances_SH.log");
my $line;
my %lig_name;
while($line=<IN>){
chomp $line;
my @words = split(' ', $line);
$lig_name{$words[1]} = $words[0];
}
close IN;
my $count=1;
foreach my $key (sort { $lig_name{$a} <=> $lig_name{$b} }keys %lig_name){
open(FILE,"</Users/gunasekp/SH/ligand/ligand_$key.pdb");
if($count<=10){
while(<FILE>){
if($_ =~ /(COMPND)\s+(\w+)\s+(.*)/){
print "$count ",$3," ",$lig_name{$key},"\n";
}
}
}
$count++;
}
......code continues
" malformed header from script. Bad header=COMPND Y 2p-DEOXY-N6-(S)STYR: /Users/gunasekp/Sites/cgi-bin/automate_cgi.pl
sh: line 1: /Users/gunasekp/web_server/Output/query.alm: Permission denied
sh: line 1: /Users/gunasekp/web_server/Output/distances_SH.lo g: Permission denied "
2)(pdb2alm and command_....) are executable c++ files which are placed in a directory in harddisk and whose configuration is (drwxr-xr-x and for files -rwxrwxrwx)
3) the output files like query.alm are written to directory whose configuration is (drwxrwxrwx and for files -rw-r--r--)
help me to solve this problems?
Prasad.
Comment