From 4b1116ca47b6e19d147ca45b7ed359eea22b95ec Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Sun, 29 Aug 2004 12:43:15 +0000 Subject: [PATCH 1/1] Added an option for overwriting files during file upload if they already exist --- modules/Command.pm | 4 ++-- templates/upload.htm | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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

+

-- 2.34.1