--- loncom/publisher/lonupload.pm 2003/08/04 17:45:06 1.18 +++ loncom/publisher/lonupload.pm 2003/08/04 18:22:55 1.19 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.18 2003/08/04 17:45:06 www Exp $ +# $Id: lonupload.pm,v 1.19 2003/08/04 18:22:55 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -163,6 +163,8 @@ sub phasetwo { ''. 'The extension on this file is reserved internally by LON-CAPA.'. ''); + $r->print('
Back to Directory'); } elsif ($fn=~/\.(\w+)$/ && !defined(&Apache::loncommon::fileembstyle($1))) { $r->print( @@ -170,6 +172,16 @@ sub phasetwo { ''. 'The extension on this file is not recognized by LON-CAPA.'. ''); + $r->print('
Back to Directory');
+ } elsif (-d $target) {
+ $r->print(
+ 'File '.$fn.' could not be copied.
'.
+ ''.
+ 'The target is an existing directory.'.
+ '');
+ $r->print('
Back to Directory'); } elsif (copy($source,$target)) { chmod(0660, $target); # Set permissions to rw-rw---. $r->print('File copied.'); @@ -179,17 +191,17 @@ sub phasetwo { '">Back to Directory'); } else { $r->print('Failed to copy: '.$!); + $r->print('
Back to Directory'); } } } else { $r->print( - 'Please pick a filename
'); - &phaseone($r,$fn,$uname,$udom); + 'Please use browser "Back" button and pick a filename
'); } } else { $r->print( - 'Please pick a filename
'); - &phaseone($r,$fn,$uname,$udom); + 'Please use browser "Back" button and pick a filename
'); } }