#!/usr/bin/perl $upload_path = "/Users/james/xgrid_drop"; $finished_location = "/Users/james/xgrid_drop/finished"; # Allowed file list info: @allowed_file_list = ("Avenger", "Banshee", "Daredevil", "DarkFog", "Dritver", "Elephant", "Falcon", "Gorilla", "Grunt", "Kicker", "Lancer", "LandingBarge", "Loader", "Loiterer", "MAP", "MSP", "MWP", "Neroid", "PSU", "Rhino", "UAV", "Valour", "Vampire", "WhiteRabbit", "WhiteTiger", "XRQ"); $start_frame = 0; $end_frame = 180; @resolution_sizes = ("_1280_960", "_640_480"); $ext = ".png"; ## use CGI; my $query=new CGI; print $query->header; # Print info #my @all=$query->param; #my $name; #foreach $name (@all) { # print "$name -> ", $query->param($name),"\n"; #} # Make sure filename is allowed $allowed = 0; foreach $i (@allowed_file_list) { for ($j = $start_frame; $j <= $end_frame; $j++) { foreach $k (@resolution_sizes) { $l = sprintf ("%0.5d",$j); $allowed = 1 if $query->param('name') eq "$i$l$k$ext"; } } } if (!$allowed) { print "Access denied.\n"; return; } my $filename = $query->param('name'); my $final_location = "$finished_location/$filename"; # Check stuff if (-e "$final_location") { print "1\n"; } else { print "0\n"; } return;