Drago Bratko Active Member Licensed User Longtime User Nov 28, 2021 #1 I have FTP server on non standard port (5021). To that FTP server I can connect and do actions with FileZilla. When I try to connect and do upload with jNet FTP, it reports this error: java.lang.RuntimeException: Error uploading file. 500 Illegal PORT range rejected. at anywheresoftware.b4a.net.FTPWrapper$2.run(FTPWrapper.java:241) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Click to expand... Sample code would be : B4X: Copy Dim ftp As FTP ftp.Initialize("ftp", "aaa.nnn.biz", 5021, "ftp-user", "somepwd") ftp.UploadFile(File.DirApp, "file.zip", False, "/file.zip") With FTP server which operates on standard port 21 same code works fine. Is there solution to be able to operate with FTP which is not on standard FTP port?
I have FTP server on non standard port (5021). To that FTP server I can connect and do actions with FileZilla. When I try to connect and do upload with jNet FTP, it reports this error: java.lang.RuntimeException: Error uploading file. 500 Illegal PORT range rejected. at anywheresoftware.b4a.net.FTPWrapper$2.run(FTPWrapper.java:241) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Click to expand... Sample code would be : B4X: Copy Dim ftp As FTP ftp.Initialize("ftp", "aaa.nnn.biz", 5021, "ftp-user", "somepwd") ftp.UploadFile(File.DirApp, "file.zip", False, "/file.zip") With FTP server which operates on standard port 21 same code works fine. Is there solution to be able to operate with FTP which is not on standard FTP port?
Erel B4X founder Staff member Licensed User Longtime User Nov 29, 2021 #2 First step is to set PassiveMode = True. Upvote 0 Solution
Drago Bratko Active Member Licensed User Longtime User Nov 29, 2021 #3 Erel said: First step is to set PassiveMode = True. Click to expand... Thank you. With only that addition, it works perfectly. Upvote 0
Erel said: First step is to set PassiveMode = True. Click to expand... Thank you. With only that addition, it works perfectly.