I'm trying to upload an Excel file to Filezilla Server (FTP)
String ruta = System.getProperty("user.dir") + "\\localdata.js";
File file = new File(ruta);
FileInputStream input = new FileInputStream(file);
client.changeWorkingDirectory(rutaRemoteFile);
client.setFileType(FTP.BINARY_FILE_TYPE);
client.enterLocalPassiveMode();
System.out.println("Subió satisfactoriamente el archivo");
if (!client.storeFile("localdata.js", input)) {
JOptionPane.showMessageDialog(null, "No se pudo completar la carga del archivo", null, JOptionPane.ERROR_MESSAGE);
}
else{
JOptionPane.showMessageDialog(null, "La carga del archivo se realizó exitosamente", null, JOptionPane.INFORMATION_MESSAGE);
}
input.close();
But the problem is that
!client.storeFile("localdata.js", input)
is always true,
So my file is not being uploaded.
Thanks in advance for any help