lilalo
view l3-upload @ 121:58c869722fd0
mini fixes
author | igor |
---|---|
date | Sun Jun 29 15:09:04 2008 +0300 (2008-06-29) |
parents | 9e6359b7ad55 |
children | 56cd2abd3e8a |
line source
1 #!/usr/bin/perl
2 #
4 use CGI;
5 $upload_dir = "/var/www/xguru/l3shot";
6 $query = new CGI;
8 $filename = $query->param("photo");
9 $filename =~ s/.*[\/\\](.*)/$1/;
10 $upload_filehandle = $query->upload("photo");
12 my $convert="";
13 if ($filename =~ s/.xwd$/.png/g) {
14 $convert="|xwdtopnm|pnmtopng";
15 }
17 open UPLOADFILE, "$convert>$upload_dir/$filename";
18 binmode UPLOADFILE;
19 while ( <$upload_filehandle> )
20 {
21 print UPLOADFILE;
22 }
24 close UPLOADFILE;
26 print $query->header ( );
27 print <<END_HTML;
28 Upload complete
29 END_HTML