in reply to Uploading files using cgi.pm
while(<$formdata{upload}>) { print; }
my $buffer; while(read $formdata{upload},$buffer,1024) { print $buffer; }
my $buffer; my $max_size = 10 * 1024; # 10 KB but it can be whatever my $size; while(read $formdata{upload},$buffer,1024) { $size += 1024; if($size > $max_size) { print "Image is too big!"; last; } }
|
|---|