From 9aaab5ffcf60b528c1fce506a1011029f5ba392a Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Mon, 30 Mar 2009 17:17:57 +0000 Subject: [PATCH] Allow to specify a remote name for an uploaded file --- modules/Command.pm | 10 +++++++++- templates/upload.htm | 9 +++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/Command.pm b/modules/Command.pm index 28c6777..2905545 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: 2005-08-01 +# Last modified: 2009-03-30 # use strict; @@ -521,6 +521,14 @@ sub exec_upload($$) if(my $uploaded_file = $cgi->param('uploaded_file')) { + if($cgi->param('remote_file')) + { + $uploaded_file = $cgi->param('remote_file'); + + $uploaded_file =~ s!/!!g; + $uploaded_file =~ s!\\!!g; + } + # Process file upload my $filename = file_name($uploaded_file); diff --git a/templates/upload.htm b/templates/upload.htm index be3e2d0..494bbb4 100644 --- a/templates/upload.htm +++ b/templates/upload.htm @@ -25,6 +25,9 @@

File to upload:

+

Remote name of the file (optional):
+

+

Transfer mode (see below):

@@ -42,6 +45,12 @@
  • Binary: The file will be uploaded as it is. Use this transfer mode for images, executable files and archives, for example. This is the default transfer mode.
  • +

    Note:

    + + +

    About Dev-Editor

    -- 2.34.1