FTP - 以编程方式确定剩余时间或字节传输? [英] FTP - way to programatically determine time remaining or bytes transfered?

查看:164
本文介绍了FTP - 以编程方式确定剩余时间或字节传输?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个FTP连接(最好使用Coldfusion 8,但Java也很好),它会将文件复制到远程服务器。

I want to make an FTP connection (ideally using Coldfusion 8, but Java is fine too) that will copy a file to a remote server.

很重要的是,我想知道已经传输了多少字节,所以我可以给用户一些反馈。

Crucially however, I want to know how many bytes have been transferred so I can give some feedback to the user.

这是可能的,如果是这样,你会推荐什么FTP API,因为我明白太阳实现可能有点缺乏。

Is this possible, and if so what FTP API would you recommend as I understand the Sun implementation may be a bit lacking.

提前感谢!

PS:我可以有另一个进程/线程轮询目的地的文件大小机器通过Web服务调用,而文件正在传输,但它不是理想的。通过FTP API获得它是最简单的解决方案。

PS: I could have another process/thread poll the file size on the destination machine via a web service call while the file is being transferred but it's not ideal. Getting it through FTP API would be the neatest solution.

推荐答案

关于CodeRanch的讨论包括一些代码片段,显示进度监视器如何与Apache commons FtpClient。

This discussion on CodeRanch includes snippets that show how a progress monitor can be implemented in conjunction with Apache commons FtpClient.

这篇关于FTP - 以编程方式确定剩余时间或字节传输?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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