lilalo
view l3-upload @ 151:80691b40e6db
см. предыдущий коммит
author | igor@chub.in |
---|---|
date | Tue Jun 23 01:17:30 2009 +0300 (2009-06-23) |
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