0

I am trying to transfer files from my computer to my local FTP server (on Xiaomi router with Padavan) with Java but I am still getting some errors. Both PC and router are on the same network.

client.connect("10.0.0.2");

client.login("username", "password");

// I also tried local active and pasive mode, and didn´t work either
client.enterRemotePassiveMode();

String filename = "D:/Files/test.txt";

fis = new FileInputStream(filename);

client.storeFile(filename, fis);

System.out.println(client.getReplyString());
// Here, I am getting status "227 Entering Passive Mode (10,0,0,2,136,7)."

client.logout();

I tried bunch of configurations (set access for accounts only, then anonymous and accounts, full access...), but every time I got 550 Access Denied or Binary mode (.. ?) statuses.

When I ran the program, I can see successful login in router logs, but usualy I get Upload Failed (with 550 status) or nothing more is shown (with 227 or 220 statuses).

Do you have any idea, what could be wrong here?

Thank you for your help!

Petr Jelínek
  • 110
  • 2
  • 11
  • @MartinPrikryl Yes, I can. I have little update, now I can upload files, but some files are damages. I can transfer text files just fine, but I photos or images have some damage... Do you have any idea? – Petr Jelínek Apr 20 '20 at 06:47
  • @MartinPrikryl Nice, works just fine. Thank you very much. :) – Petr Jelínek Apr 20 '20 at 07:10

0 Answers0