lilalo
view l3-upload @ 154:71d6b2a6b8eb
Ветка с поддержкой sqlite в l3-agent'е
author | igor@book.xt.vpn |
---|---|
date | Mon Dec 28 22:00:37 2009 +0300 (2009-12-28) |
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