AndFTP Intent to download file from FTP server

1 vote · 1 comment

FTP transfer intents are available for any application since AndFTP 1.4. Developer can rely on AndFTP to download or upload files over FTP, SFTP or FTPS. AndFTP 1.4 can be found on market or at: http://www.lysesoft.com/products/andftp/index.html

raw ·
copy
· download
private static final int DOWNLOAD_FILES_REQUEST = 1; Intent intent = new Intent(); intent.setAction(Intent.ACTION_PICK); // FTP URL (Starts with ftp://, sftp:// or ftps:// followed by hostname and port). Uri ftpUri = Uri.parse("ftp://yourftpserver.com"); intent.setDataAndType(ftpUri, "vnd.android.cursor.dir/lysesoft.andftp.uri"); // FTP credentials (optional) intent.putExtra("ftp_username", "anonymous"); intent.putExtra("ftp_password", "something@somewhere.com"); //intent.putExtra("ftp_keyfile", "/sdcard/dsakey.txt"); //intent.putExtra("ftp_keypass", "optionalkeypassword"); // FTP settings (optional) intent.putExtra("ftp_pasv", "true"); //intent.putExtra("ftp_resume", "true"); //intent.putExtra("ftp_encoding", "UTF8"); // Download intent.putExtra("command_type", "download"); // Activity title intent.putExtra("progress_title", "Downloading files ..."); // Remote files to download. intent.putExtra("remote_file1", "/remotefolder/subfolder/file1.zip"); intent.putExtra("remote_file2", "/remotefolder/subfolder/file2.zip"); // Target local folder where files will be downloaded. intent.putExtra("local_folder", "/sdcard/localfolder"); startActivityForResult(intent, DOWNLOAD_FILES_REQUEST);
Add a comment

1 Comment

i wanna let you know, you are one of the best sites for android developers :)

Reply · Sept. 4, 2011, 7:55 a.m.