FTPClient Uploading File = SocketException: Connection reset

后端 未结 3 1125
终归单人心
终归单人心 2021-02-06 02:07

I\'m trying to upload a simple txt file via FTP using XAMPP and FileZilla.
I\'m using the Apache Commons Net 3.0.1 Library.
This is my code, very basic things:



        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 02:41

    I'm honestly not sure but you should try the following:

    Use something like the following code:

    System.out.println(client.getReplyCode());
    for(String s : client.getReplyStrings())
        System.out.println(s);
    

    after client.login("user", "password"); to verify the status of your connection.

    If you don't get any good hints from the code above, after invoking client.storeFile("textfile.txt", in); try to add client.completePendingCommand();.

    Good luck! :)

提交回复
热议问题