Diff for /loncom/publisher/lonupload.pm between versions 1.10 and 1.12

version 1.10, 2001/12/17 00:57:59 version 1.12, 2002/08/08 02:30:39
Line 1 Line 1
   
 # The LearningOnline Network with CAPA  # The LearningOnline Network with CAPA
 # Handler to upload files into construction space  # Handler to upload files into construction space
 #  #
Line 55  use File::Copy; Line 56  use File::Copy;
 use Apache::Constants qw(:common :http :methods);  use Apache::Constants qw(:common :http :methods);
 use Apache::loncacc;  use Apache::loncacc;
 use Apache::loncommon();  use Apache::loncommon();
   use Apache::Log();
   
   my $DEBUG=0;
   
   sub Debug {
     
     # Marshall the parameters.
     
     my $r       = shift;
     my $log     = $r->log;
     my $message = shift;
     
     # Put out the indicated message butonly if DEBUG is false.
     
     if ($DEBUG) {
       $log->debug($message);
     }
   }
   
 sub upfile_store {  sub upfile_store {
     my $r=shift;      my $r=shift;
Line 85  sub phaseone { Line 104  sub phaseone {
     $fn.=$ENV{'form.upfile.filename'};      $fn.=$ENV{'form.upfile.filename'};
     $fn=~s/^\///;      $fn=~s/^\///;
     $fn=~s/(\/)+/\//g;      $fn=~s/(\/)+/\//g;
       $fn=~s/%20/ /g;
       &Debug($r, "Filename for upload: $fn");
     if (($fn) && ($fn!~/\/$/)) {      if (($fn) && ($fn!~/\/$/)) {
       $r->print(        $r->print(
  '<form action=/adm/upload method=post>'.   '<form action=/adm/upload method=post>'.
Line 156  sub phasetwo { Line 176  sub phasetwo {
  'The extension on this file is not recognized by LON-CAPA.'.   'The extension on this file is not recognized by LON-CAPA.'.
  '</font>');   '</font>');
    } elsif (copy($source,$target)) {     } elsif (copy($source,$target)) {
          chmod(0660, $target); # Set permissions to rw-rw---.
       $r->print('File copied.');        $r->print('File copied.');
               $r->print('<p><font size=+2><a href="'.$fn.                $r->print('<p><font size=+2><a href="'.$fn.
                         '">View file</a></font>');                          '">View file</a></font>');

Removed from v.1.10  
changed lines
  Added in v.1.12


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>