--- loncom/publisher/lonupload.pm 2004/03/31 05:24:00 1.26 +++ loncom/publisher/lonupload.pm 2004/05/14 14:53:31 1.27 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.26 2004/03/31 05:24:00 albertel Exp $ +# $Id: lonupload.pm,v 1.27 2004/05/14 14:53:31 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -180,6 +180,8 @@ sub phasetwo { ''); } else { my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp'; + my $dirpath=$path.'/'; + $dirpath=~s/\/+/\//g; # Check for bad extension and disallow upload if ($fn=~/\.(\w+)$/ && (&Apache::loncommon::fileembstyle($1) eq 'hdn')) { @@ -188,7 +190,7 @@ sub phasetwo { ''. &mt('The extension on this file is reserved internally by LON-CAPA.'). ''); - $r->print('
'. + $r->print('
'. &mt('Back to Directory').''); } elsif ($fn=~/\.(\w+)$/ && !defined(&Apache::loncommon::fileembstyle($1))) { @@ -197,14 +199,14 @@ sub phasetwo { ''. &mt('The extension on this file is not recognized by LON-CAPA.'). ''); - $r->print('
'. + $r->print('
'. &mt('Back to Directory').''); } elsif (-d $target) { $r->print('File '.$fn.' could not be copied.
'. ''. &mt('The target is an existing directory.'). '
'); - $r->print(''. + $r->print(''. &mt('Back to Directory').''); } elsif (copy($source,$target)) { chmod(0660, $target); # Set permissions to rw-rw---. @@ -215,7 +217,7 @@ sub phasetwo { $r->print(&mt('File copied.')); $r->print('
'. &mt('View file').''); - $r->print('
'. + $r->print('
'. &mt('Back to Directory').'
'); } } else {