--- loncom/publisher/lonupload.pm 2002/08/05 02:22:56 1.11 +++ loncom/publisher/lonupload.pm 2002/08/08 02:30:39 1.12 @@ -1,7 +1,8 @@ + # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.11 2002/08/05 02:22:56 foxr Exp $ +# $Id: lonupload.pm,v 1.12 2002/08/08 02:30:39 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -55,6 +56,24 @@ use File::Copy; use Apache::Constants qw(:common :http :methods); use Apache::loncacc; use Apache::loncommon(); +use Apache::Log(); + +my $DEBUG=0; + +sub Debug { + + # Marshall the parameters. + + my $r = shift; + my $log = $r->log; + my $message = shift; + + # Put out the indicated message butonly if DEBUG is false. + + if ($DEBUG) { + $log->debug($message); + } +} sub upfile_store { my $r=shift; @@ -85,7 +104,8 @@ sub phaseone { $fn.=$ENV{'form.upfile.filename'}; $fn=~s/^\///; $fn=~s/(\/)+/\//g; - + $fn=~s/%20/ /g; + &Debug($r, "Filename for upload: $fn"); if (($fn) && ($fn!~/\/$/)) { $r->print( '
'.