--- loncom/publisher/loncfile.pm 2003/02/10 23:19:45 1.25 +++ loncom/publisher/loncfile.pm 2003/02/10 23:26:15 1.26 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.25 2003/02/10 23:19:45 albertel Exp $ +# $Id: loncfile.pm,v 1.26 2003/02/10 23:26:15 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -764,6 +764,10 @@ sub NewFile1 { if ($ENV{'form.action'} =~ /new(.+)file/) { my $extension=$1; if ($newfilename !~ /\Q.$extension\E$/) { + if ($newfilename =~ m|^[^\.]*\.([^\.]+)$|) { + #already has an extension strip it and add in expected one + $newfilename =~ s|.([^\.]+)$||; + } $newfilename.=".$extension"; } }