android andftp源码,FTP, FTPS, SCP and SFTP Android client - AndFTP

Does AndFTP provide an Intent to download files from FTP server?Yes, you need to start an Activity for regular PICK intent with parameters data and the following type: vnd.android.cursor.dir/lysesoft.andftp.uri. For instance:

...

Intent intent = new Intent();

intent.setAction(Intent.ACTION_PICK);

// FTP URL (Starts with ftp://, sftp://, scp:// 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", "test@test.com");

// FTP settings (optional)

intent.putExtra("ftp_pasv", "true");

// 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");

// Target local folder where files will be downloaded.

intent.putExtra("local_folder", "/sdcard/localfolder");

startActivityForResult(intent, 0);Full Intents documentationf2886ca5b6e5f31d68f3ad7ea3cb12ac.gif is available here. More samples are available in the forum.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值