File: get_ftp

package info (click to toggle)
gzilla 0.1.5-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 972 kB
  • ctags: 1,396
  • sloc: ansic: 15,102; sh: 173; makefile: 117; perl: 18
file content (15 lines) | stat: -rwxr-xr-x 431 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl

# A hacked-together bit of gorp to fetch FTP urls

$| = 1;
$url = $ENV{'REQUEST_URI'};
system "lynx -source $url > /tmp/get_ftp.$$";
$ctype = "text/plain";
if ($url =~ /\.(htm|html)/i) { $ctype = "text/html"; }
if ($url =~ /\.gif/i) { $ctype = "image/gif"; }
if ($url =~ /\.(jpg|jpeg)/i) { $ctype = "image/jpg"; }
print "Content-Type: $ctype\n";
print "\n";
system "cat /tmp/get_ftp.$$";
unlink "/tmp/get_ftp.$$";