From: pcanterino <> Date: Sun, 29 Aug 2004 12:43:15 +0000 (+0000) Subject: Added an option for overwriting files during file upload if they already exist X-Git-Tag: version_2_1~8 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/4b1116ca47b6e19d147ca45b7ed359eea22b95ec?hp=cce599a39987c9c15d4afcb771e377ea4df31ac6 Added an option for overwriting files during file upload if they already exist --- diff --git a/modules/Command.pm b/modules/Command.pm index a25f8f0..46798ee 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# 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'); diff --git a/templates/upload.htm b/templates/upload.htm index 2b99128..cdc1f37 100644 --- a/templates/upload.htm +++ b/templates/upload.htm @@ -30,6 +30,8 @@

Transfer mode (see below):
ASCII Binary (default)

+

Overwrite file if it already exists

+