你如何在Android应用程序上传图片到FTP服务器? [英] How do you upload images to an FTP server within an Android app?

查看:275
本文介绍了你如何在Android应用程序上传图片到FTP服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能从我的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/

这篇关于你如何在Android应用程序上传图片到FTP服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆