FTP进度条文件上传 [英] FTP progress bar uploading file

查看:411
本文介绍了FTP进度条文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我使用apache.commons.net从SD卡上传我的文件,按文件吉拉创建的FTP服务器。然而,所有我想要做的是显示进度给用户。你可以帮我吗?
这里是我的code:

Hi guys I am using apache.commons.net to upload my files from sd card to a ftp server created by file zilla. However, all I want to do is to show the progress to the users. Could you please help me? here is my code:

http://pastie.org/4433482

推荐答案

如果万一你永远解决不了你的问题呢。我认为这个问题是此行中
publishProgress

if in case you never solve your problem yet. I think the problem is within this line publishProgress

((INT)((totalBytesTransferred / file.length())* 100))

而不是尝试这种

publishProgress((int) ((totalBytesTransferred * 100)/file.length()))

这篇关于FTP进度条文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆