lilalo

diff l3-upload @ 113:8287cb3530de

sever files added
author igor
date Sun Mar 09 02:34:52 2008 +0200 (2008-03-09)
parents
children 9e6359b7ad55
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/l3-upload	Sun Mar 09 02:34:52 2008 +0200
     1.3 @@ -0,0 +1,31 @@
     1.4 +#!/usr/bin/perl
     1.5 +#
     1.6 +
     1.7 +use CGI;
     1.8 +$upload_dir = "/var/www/xguru/l3shot";
     1.9 +$query = new CGI;
    1.10 +
    1.11 +$filename = $query->param("photo"); 
    1.12 +$filename =~ s/.*[\/\\](.*)/$1/;
    1.13 +$upload_filehandle = $query->upload("photo");
    1.14 +
    1.15 +my $convert="";
    1.16 +if ($filename =~ s/.xwd$/.png/g) {
    1.17 +    $convert="|xwdtopnm|pnmtopng";
    1.18 +}
    1.19 +
    1.20 +open UPLOADFILE, "$convert>$upload_dir/$filename";
    1.21 +binmode UPLOADFILE;
    1.22 +while ( <$upload_filehandle> )
    1.23 +{
    1.24 +    print UPLOADFILE;
    1.25 +}
    1.26 +
    1.27 +close UPLOADFILE;
    1.28 +
    1.29 +print $query->header ( );
    1.30 +print <<END_HTML;
    1.31 +Upload complete
    1.32 +END_HTML
    1.33 +
    1.34 +