I am facing some problem while trying to upload a file on my ftp server with java. here is my code function :
public static void upload_files(String un, String pw, String ip, String f){
try
{
FTPClient client = new FTPClient();
client.connect(ip);
client.login(un,pw);
InputStream is = new FileInputStream(f);
client.storeFile("test2",is);
is.close();
} catch(Exception e) {
e.printStackTrace();
}
}
"f" is the path of the file I want to upload (ie "C:\myfile"). No error during the compilation, one file is well sent to the server, but sadly empty (0 byte).
I also noticed that it takes quite long for a simple upload of some text (around 40s) even thought I got a really good ISP.
I thank in advance all people who will help me.
Regards,