--- loncom/interface/londocs.pm 2005/06/08 18:49:38 1.179 +++ loncom/interface/londocs.pm 2005/06/08 19:36:54 1.180 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.179 2005/06/08 18:49:38 www Exp $ +# $Id: londocs.pm,v 1.180 2005/06/08 19:36:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1036,10 +1036,17 @@ sub editor { if (($env{'form.uploaddoc.filename'}) && ($env{'form.cmd'}=~/^upload_(\w+)/)) { if ( ($folder=~/^$1/) || ($1 eq 'default') ) { + my $destination = 'docs/'; + if ($folder eq 'default') { + $destination .= 'default/'; + } elsif ($folder =~ /^default_(\d+)$/) { + $destination .= $1.'/'; + } # this is for a course, not a user, so set coursedoc flag # probably the only place in the system where this should be "1" my $newidx=$#Apache::lonratedt::resources+1; - my $url=&Apache::lonnet::userfileupload('uploaddoc',1,'docs/'.$newidx); + $destination .= $newidx; + my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination); my $ext='false'; if ($url=~/^http\:\/\//) { $ext='true'; } $url=~s/\:/\:/g;