3
FTPClient con = new FTPClient();
try
{
con.connect(HOST);
if (con.login (LOGIN, PASSWORD))
{
con.enterLocalPassiveMode();
InputStream instream = context.openFileInput(filename);
con.storeFile(filename, instream);
instream.close();
}
}
catch (Exception e)
{
e.printStackTrace();
}
try
{
con.logout();
con.disconnect();
}
隨着它工作的文本文件。隨着圖像文件,圖像很奇怪:
如何糾正它嗎?
哪一個FTP庫您使用?嘗試以二進制模式傳輸圖像。 – Farhan
Common Apache 3.0.1 – J3n