你如何在Android应用程序上传图片到FTP服务器?上传图片、应用程序、服务器、如何在

2023-09-06 04:00:01 作者:左岸

是否有可能从我的Andr​​oid应用程序上传图片到FTP服务器?图像将已使用相机拍摄的。

Is it possible to upload an image from my Android application to an FTP server? The image will have already been captured using the camera.

在一个桌面应用程序,我们可以使用FTP客户端的任何文件/图片上传到活动服务器。我们怎样才能做到我们的Andr​​oid应用程序中类似的东西?

In a desktop application, we'd use FTP Client to upload any file / image to a live server. How can we do something similar within our Android application?

推荐答案

使用这个是工作的罚款,我...

Use this it is working fine for me...

SimpleFTP ftp = new SimpleFTP();


                // Connect to an FTP server on port 21.
                ftp.connect("server address", 21, "username", "pwd");

                // Set binary mode.
                ftp.bin();

                // Change to a new working directory on the FTP server.


                ftp.cwd("path");

                // Upload some files.
                ftp.stor(new File("your-file-path"));              

                // Quit from the FTP server.
                ftp.disconnect();

有关详细信息和罐子...... http://www.jibble.org/simpleftp/

for more info and jar ...http://www.jibble.org/simpleftp/