#!/usr/local/bin/perl -w use CGI; $perl58_NG = 1; # perl 5.8 だと NG になるパターン # print "Content-Type: text/html\r\n\r\n"; # # ファイル情報 # if ( $perl58_NG == 1 ) { print "perl 58 NG root\r\n"; $filename = &getQuery(); # こっちだと perl 5.8 では NG } else { print "perl 58 OK root\r\n"; $query = new CGI; $filename = $query->upload('filename'); } # $savename = $filename; ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat( $filename ); print "Size=$size\r\n"; open (OUT, "> $savename") || &error("Can't open $savename"); while(read($filename, $buffer, 1024)){ print OUT $buffer; } close (OUT); print "filename=".$savename."\r\n"; exit; # sub getQuery { my( $filename, $query ); $query = new CGI; $filename = $query->upload('filename'); return( $filename ); } |