IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 7, 2008, 3:59:25 PM (18 years ago)
Author:
bills
Message:

Allow the data store server to be installed without a full IPP installation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStoreServer/web/cgi/dsfits.cgi

    r16763 r17381  
    1 #!/usr/bin/env perl
    2 
    3 use strict;
    4 use CGI ':standard';
    5 
    6 my $DS_DIR = '/var/www/html/ds/dsroot';
    7 #my $DS_DIR = '.';
    8 
    9 my $uri = $ENV{'REQUEST_URI'};
    10 
    11 $uri = $ARGV[0];
    12 print STDERR "uri is $uri\n";
    13 
    14 (my $left, my $param) = split(/\,/, $uri);
    15 
    16 print STDERR "left: $left param: $param\n";
    17 
    18 if ($left !~ /\.fits$/) {
    19         print header( -status => '404 Not Found' );
    20         exit;
    21 }
    22 
    23 my @path = split(/\//, $left);
    24 
    25 my $fn = @path[$#path];
    26 my $fpath = $DS_DIR.'/'.$left;
    27 
    28 
    29 
    30 print header(   -type => 'image/fits',
    31                                 -attachment => $fn,
    32                                 -content_length => -s $fpath,
    33                         );
    34 
    35 
    36 open F, $DS_DIR.'/'.$left;
    37 
    38 binmode(F);
    39 binmode(STDOUT);
    40 
    41 print while (<F>);
    42 
    43 close F;
     1#!/bin/bash
     2. ./dsshellconfig
     3./dodsfits $*
Note: See TracChangeset for help on using the changeset viewer.