Intent to download file(s)

FTP client for Android handsets.
Post Reply
Posts: 853
Joined: Sun Apr 20, 2008 4:40 pm

Intent to download file(s)

Post by support »

You can call AndFTP intent to download file(s) from FTP server to SDCard.

Code: Select all

Intent intent = new Intent();
// FTP URL (Starts with ftp://, sftp:// or ftps:// followed by hostname and port).
Uri ftpUri = Uri.parse("");
intent.setDataAndType(ftpUri, "");
// FTP credentials (optional)
intent.putExtra("ftp_username", "anonymous");
intent.putExtra("ftp_password", "");
//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/");
intent.putExtra("remote_file2", "/remotefolder/subfolder/");
// Target local folder where files will be downloaded.
intent.putExtra("local_folder", "/sdcard/localfolder");			
startActivityForResult(intent, 0);
It will open the transfer dialog:
Download files
Download files
intent_download_files.png (21.58 KiB) Viewed 6747 times

Post Reply