]> git.p6c8.net - devedit.git/blobdiff - modules/Command.pm
Added an option for overwriting files during file upload if they already exist
[devedit.git] / modules / Command.pm
index a25f8f084113268d851fbc8d71abd6d9cee80493..46798eec4236b7f521959e39ff4185ddc554efe0 100644 (file)
@@ -6,7 +6,7 @@ package Command;
 # Execute Dev-Editor's commands
 #
 # Author:        Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2004-08-02
+# Last modified: 2004-08-29
 #
 
 use strict;
@@ -476,7 +476,7 @@ sub exec_upload($$)
   my $file_phys = $physical."/".$filename;
   my $file_virt = $virtual."".$filename;
 
-  return error($config->{'errors'}->{'file_exists'},$virtual,{FILE => $file_virt}) if(-e $file_phys);
+  return error($config->{'errors'}->{'file_exists'},$virtual,{FILE => $file_virt}) if(-e $file_phys && not $cgi->param('overwrite'));
 
   my $ascii     = $cgi->param('ascii');
   my $handle    = $cgi->upload('uploaded_file');

patrick-canterino.de