my $fn = $html->param ('photofile'); my $fh = $html->upload ('photofile'); #### # # This could get a little hairy. We don't know how big a picture the user i # give us. We're going to limit him to 512K. That should cover anything we # of. # while ((length ($photo) <= (512 * 1024)) && read ($fh, $buffer, 1024)) { $photo .= $buffer; } if (length ($photo) == (512 * 1024)) { print_file ("File too big!"); return; }