lilalo

annotate l3-upload @ 113:8287cb3530de

sever files added
author igor
date Sun Mar 09 02:34:52 2008 +0200 (2008-03-09)
parents
children 9e6359b7ad55
rev   line source
igor@113 1 #!/usr/bin/perl
igor@113 2 #
igor@113 3
igor@113 4 use CGI;
igor@113 5 $upload_dir = "/var/www/xguru/l3shot";
igor@113 6 $query = new CGI;
igor@113 7
igor@113 8 $filename = $query->param("photo");
igor@113 9 $filename =~ s/.*[\/\\](.*)/$1/;
igor@113 10 $upload_filehandle = $query->upload("photo");
igor@113 11
igor@113 12 my $convert="";
igor@113 13 if ($filename =~ s/.xwd$/.png/g) {
igor@113 14 $convert="|xwdtopnm|pnmtopng";
igor@113 15 }
igor@113 16
igor@113 17 open UPLOADFILE, "$convert>$upload_dir/$filename";
igor@113 18 binmode UPLOADFILE;
igor@113 19 while ( <$upload_filehandle> )
igor@113 20 {
igor@113 21 print UPLOADFILE;
igor@113 22 }
igor@113 23
igor@113 24 close UPLOADFILE;
igor@113 25
igor@113 26 print $query->header ( );
igor@113 27 print <<END_HTML;
igor@113 28 Upload complete
igor@113 29 END_HTML
igor@113 30
igor@113 31