Skip to content

Commit 8bf7e89

Browse files
committed
Fix: Set FTP file type to binary if binaryMode is enabled
Added a check to ensure that the FTP file type is set to binary when the binaryMode flag is enabled. This ensures that files are transferred in binary mode, which is necessary for handling non-text files correctly.
1 parent 64b5529 commit 8bf7e89

File tree

1 file changed

+5
-0
lines changed
  • plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp

1 file changed

+5
-0
lines changed

plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtp.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.List;
2828
import java.util.regex.Matcher;
2929
import java.util.regex.Pattern;
30+
import org.apache.commons.net.ftp.FTP;
3031
import org.apache.commons.net.ftp.FTPClient;
3132
import org.apache.commons.net.ftp.FTPFile;
3233
import org.apache.commons.vfs2.FileObject;
@@ -436,6 +437,10 @@ public Result execute(Result previousResult, int nr) {
436437
limitFiles = Const.toInt(resolve(getNrLimit()), 10);
437438
}
438439

440+
if (binaryMode) {
441+
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
442+
}
443+
439444
// Get the files in the list...
440445
for (FTPFile ftpFile : ftpFiles) {
441446

0 commit comments

Comments
 (0)