lilalo
view l3-upload @ 147:94f587855947
mass upload
author | igor@book.xt.vpn |
---|---|
date | Tue Dec 16 00:17:33 2008 +0200 (2008-12-16) |
parents | 58c869722fd0 |
children |
line source
1 #!/usr/bin/perl
2 #
3 BEGIN {
4 chdir("/etc/lilalo/");
5 require l3config;
6 l3config::init_config();
7 };
9 use CGI;
10 $upload_dir = "/var/www/xguru/l3shot";
11 $query = new CGI;
13 $filename = $query->param("photo");
14 $filename =~ s/.*[\/\\](.*)/$1/;
15 $upload_filehandle = $query->upload("photo");
17 my $convert="";
18 if ($filename =~ s/.xwd$/.png/g) {
19 $convert="|xwdtopnm|pnmtopng";
20 }
22 open UPLOADFILE, "$convert>$upload_dir/$filename";
23 binmode UPLOADFILE;
24 while ( <$upload_filehandle> )
25 {
26 print UPLOADFILE;
27 }
29 close UPLOADFILE;
31 print $query->header ( );
32 print <<END_HTML;
33 Upload complete
34 END_HTML