-1

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

1 Answers1

0

I figured it out. Turns out that the user didn't have permission to write on the FTP folder. Once the permissions were granted, everything ran smoothly.