--- loncom/publisher/lonupload.pm 2004/05/14 14:53:31 1.27 +++ loncom/publisher/lonupload.pm 2005/04/07 06:56:27 1.29 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.27 2004/05/14 14:53:31 www Exp $ +# $Id: lonupload.pm,v 1.29 2005/04/07 06:56:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,6 +41,7 @@ use Apache::Log(); use Apache::lonnet; use HTML::Entities(); use Apache::lonlocal; +use Apache::lonnet; my $DEBUG=0; @@ -62,17 +63,17 @@ sub Debug { sub upfile_store { my $r=shift; - my $fname=$ENV{'form.upfile.filename'}; + my $fname=$env{'form.upfile.filename'}; $fname=~s/\W//g; - chomp($ENV{'form.upfile'}); + chomp($env{'form.upfile'}); - my $datatoken=$ENV{'user.name'}.'_'.$ENV{'user.domain'}. + my $datatoken=$env{'user.name'}.'_'.$env{'user.domain'}. '_upload_'.$fname.'_'.time.'_'.$$; { my $fh=Apache::File->new('>'.$r->dir_config('lonDaemons'). '/tmp/'.$datatoken.'.tmp'); - print $fh $ENV{'form.upfile'}; + print $fh $env{'form.upfile'}; } return $datatoken; } @@ -86,12 +87,12 @@ sub phaseone { } elsif ($mode eq 'imsimport') { $action = '/adm/imsimport'; } - $ENV{'form.upfile.filename'}=~s/\\/\//g; - $ENV{'form.upfile.filename'}=~s/^.*\/([^\/]+)$/$1/; - if ($ENV{'form.upfile.filename'}) { + $env{'form.upfile.filename'}=~s/\\/\//g; + $env{'form.upfile.filename'}=~s/^.*\/([^\/]+)$/$1/; + if ($env{'form.upfile.filename'}) { $fn=~s/\/[^\/]+$//; $fn=~s/([^\/])$/$1\//; - $fn.=$ENV{'form.upfile.filename'}; + $fn.=$env{'form.upfile.filename'}; $fn=~s/^\///; $fn=~s/(\/)+/\//g; @@ -100,7 +101,7 @@ sub phaseone { &Debug($r, "Filename for upload: $fn"); if (($fn) && ($fn!~/\/$/)) { - $r->print('