version 1.3, 2003/02/03 18:03:52
|
version 1.4, 2005/04/07 06:56:21
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# YEAR=2001 |
|
# 8/15,9/28,12/11 |
|
# |
|
### |
### |
|
|
# Example usage: /cgi-bin/thumbnail.gif?url=... |
# Example usage: /cgi-bin/thumbnail.gif?url=... |
Line 56 sub filelocation {
|
Line 53 sub filelocation {
|
return $location; |
return $location; |
} |
} |
|
|
|
my %env; |
|
|
$|=1; # Autoflush after each print/write |
$|=1; # Autoflush after each print/write |
foreach (split(/&/,$ENV{'QUERY_STRING'})) { |
foreach (split(/&/,$ENV{'QUERY_STRING'})) { |
my ($name, $value) = split(/=/,$_); |
my ($name, $value) = split(/=/,$_); |
$value =~ tr/+/ /; |
$value =~ tr/+/ /; |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
if ($name eq 'url') { |
if ($name eq 'url') { |
$ENV{'form.'.$name}=$value; |
$env{'form.'.$name}=$value; |
} |
} |
} |
} |
|
|
|
|
my $ofn=&filelocation('',$ENV{'form.url'}); |
my $ofn=&filelocation('',$env{'form.url'}); |
my $fn=$ofn.'.thumbnail'; |
my $fn=$ofn.'.thumbnail'; |
|
|
my $exists=1; |
my $exists=1; |