source: celo/trunk/cgi/download.cgi

Last change on this file was 381, checked in by joshuadf, 13 years ago

Add custom scripts for import/export of Excel data; these are in rough form but work for the Stevens lab

  • Property svn:executable set to *
File size: 728 bytes
Line 
1#!/usr/bin/perl
2
3use CGI;
4use Date::Manip;
5use File::Basename;
6use File::Path;
7
8my $cgi = new CGI;     
9$f = '/tmp/.celotmp/' . $ENV{'QUERY_STRING'};
10$n = basename($f);
11$d = '/usr/local/databases/wirm/celo/htdocs/d';
12
13# clear out all old tmp files
14opendir(D,$d);
15my @files = readdir(D);
16foreach $i (@files)
17{
18    rmtree("$d/$i") unless ($i =~ /^\./);
19}
20
21my $tmploc = UnixDate("today","%Y-%m-%d-$$") ;
22mkdir("$d/$tmploc", 0700) || die "Cannot mkdir : $!";
23symlink("$f", "$d/$tmploc/$n") || die "Cannot symlink $f: $!";
24
25#print "Content-type: text/html\n\n<html><h1>\n";
26#print "Content-type: binary/octet-stream\n";
27print "Content-type: text/plain\n";
28print "Location: https://celo.biostr.washington.edu/celo/d/$tmploc/$n\n\n";
Note: See TracBrowser for help on using the repository browser.