Changeset 24597

Show
Ignore:
Timestamp:
14.09.2011 10:38:59 (8 years ago)
Author:
davidb
Message:

Modifications to help image-server.pl run under Greenstone3 on Windows

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/imageaction.pm

    r19499 r24597  
    9898    } 
    9999 
    100     my $collect_directory = &util::filename_cat($gsdlhome, "collect"); 
     100    my $site = $self->{'site'}; 
     101    my $collect_directory = $gsdl_cgi->get_collection_dir($site); 
     102    #my $collect_directory = &util::filename_cat($gsdlhome, "collect"); 
    101103#    $gsdl_cgi->checked_chdir($collect_directory); 
    102104 
     
    172174    # now output it with suitable mime header 
    173175    print STDOUT "Content-type:$mime_type\n\n"; 
    174     system("cat \"$dst_full_assoc_filename\""); 
     176 
     177    if (open(IMGIN,"<$dst_full_assoc_filename")) { 
     178        binmode IMGIN; 
     179        binmode STDOUT; 
     180         
     181        my $data;         
     182        while (read(IMGIN,$data,1024) != 0) {  
     183        print STDOUT $data; 
     184        }  
     185 
     186        close(IMGIN); 
     187 
     188        #system("cat \"$dst_full_assoc_filename\""); 
     189    } 
     190    else { 
     191        $gsdl_cgi->generate_error("Unable to open $dst_full_assoc_filename for output"); 
     192    } 
    175193    } 
    176194    else {