Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you upload images to an FTP server within an Android app?

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.

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?

like image 557
Shah Avatar asked Jun 24 '11 06:06

Shah


People also ask

Can FTP transfer images?

By connecting to an FTP server, you can send images on the camera to a computer. With FTP transfer, you can automatically transfer each image to the FTP server as you shoot or transfer a set of images together.


1 Answers

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();

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

like image 186
Sujit Avatar answered Sep 21 '22 17:09

Sujit