如何使用FTPClient将图像上传到FTP?

J3n*_*J3n 3 ftp android image

我正在使用

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();
}
Run Code Online (Sandbox Code Playgroud)

使用文本文件它可以工作.使用图像文件,图像非常奇怪:

图片

怎么纠正呢?