我制作了这个ftp方法,但文件没有在ftp服务器上复制。谁能告诉我这是什么问题?
FTPClient client = new FTPClient();
FileInputStream fis = null;
try {
client.connect("ftp.atw.hu");
client.login("festivale", "****");
Log.d("TravellerLog :: ", "Csatlakozva: ftp.atw.hu");
//
// Create an InputStream of the file to be uploaded
//
String filename = "/mnt/sdcard/Festivale/Festivale.db";
// String substr = filename.substring(22,filename.length());
// Log.d("TravellerLog :: ", "String: " +substr);
fis = new FileInputStream(filename);
//
// Store file to server
//
client.storeFile("Festivale.db", fis);
Log.d("TravellerLog :: ", "Feltöltve");
client.logout();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (fis != null) {
fis.close();
}
client.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
apk正确连接到ftp服务器。该文件是在ftp服务器上创建的,但它是0kb。
感谢。