Intent to upload a full folder (including subfolder)

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

Intent to upload a full folder (including subfolder)

Post by support »

You can call AndFTP intent to upload a full folder to FTP/FTPS/SFTP server:

Code: Select all

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");
// Upload
intent.putExtra("command_type", "upload");
// Activity title
intent.putExtra("progress_title", "Uploading folder ...");
intent.putExtra("local_file1", "/sdcard/localfolder");
// Optional initial remote folder (it must exist before upload)
intent.putExtra("remote_folder", "remotefolder/uploadedfolder");
startActivityForResult(intent, 2);
It will open upload dialog:
Upload full folder
Upload full folder
intent_upload_folder.png (21.59 KiB) Viewed 2807 times

Post Reply