--- loncom/interface/lonerrorhandler.pm 2008/11/18 19:14:22 1.19 +++ loncom/interface/lonerrorhandler.pm 2009/01/04 19:49:19 1.22 @@ -1,7 +1,7 @@ # The LearningOnline Network # Internal Server Error Handler # -# $Id: lonerrorhandler.pm,v 1.19 2008/11/18 19:14:22 jms Exp $ +# $Id: lonerrorhandler.pm,v 1.22 2009/01/04 19:49:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,24 +26,7 @@ # http://www.lon-capa.org/ # -=pod - -=head1 NAME - -Apache::lonerrorhandler.pm - -=head1 SYNOPSIS - -Handles errors. - -This is part of the LearningOnline Network with CAPA project -described at http://www.lon-capa.org. - -=head1 OVERVIEW - -None -=cut package Apache::lonerrorhandler; @@ -122,6 +105,18 @@ ENDMESSAGE my $env=''; my $syllabus=''; + foreach $envkey (keys(%env)) { + if ($envkey =~ /^form\.(.+)\.filename$/) { + my $item = $1; + if (exists($env{'form.'.$item.'.mimetype'})) { + if (exists($env{'form.'.$item})) { + my $size = (length($env{'form.'.$item}))/(1024.0 * 1024.0); + $env{'form.'.$item} = &mt('File (contents not shown) - size was [_1] MB.',sprintf("%.4f",$size)); + } + } + } + } + foreach $envkey (sort(keys(%env))) { $env.="$envkey: $env{$envkey}\n"; } @@ -161,7 +156,7 @@ ENDMESSAGE

- +

'.&mt('Thank you for your help!').'

@@ -182,3 +177,23 @@ $syllabus.' 1; __END__ + + +=pod + +=head1 NAME + +Apache::lonerrorhandler.pm + +=head1 SYNOPSIS + +Handles errors. + +This is part of the LearningOnline Network with CAPA project +described at http://www.lon-capa.org. + +=head1 OVERVIEW + +None + +=cut