I'm currently using this code to send a database over ftp (Using apache commons)
File file = getDatabasePath("database");
FTPClient ftp = new FTPClient();
try {
ftp.connect(InetAddress.getByName(domain));
ftp.login(username, password);
ftp.setFileType(FTP.BINARY_FILE_TYPE);
FileInputStream is = new FileInputStream(file);
BufferedInputStream buffIn = new BufferedInputStream(is);
ftp.enterLocalPassiveMode();
ftp.storeFile("database", buffIn);
buffIn.close();
ftp.logout();
ftp.disconnect();
} catch (Exception e) {
// TODO: handle exception
}
I've used it to send a text file and it works. However, I've tried it with my database and a file of the same size is put on the server but SQLite browser displays nothing when I open it. It works on a really small database but as soon as the database is larger I get this problem.
I was wondering if it could be to do with the buffer size? Could anyone shed some light on why this is happening?
Thanks