From: pcanterino <> Date: Mon, 30 Mar 2009 17:17:57 +0000 (+0000) Subject: Allow to specify a remote name for an uploaded file X-Git-Tag: version_3_1~22 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/9aaab5ffcf60b528c1fce506a1011029f5ba392a?hp=6cb088cea794fc67941b4e174fe9ed80c8a45875 Allow to specify a remote name for an uploaded file --- 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