问题描述
我想建立一个 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,因为我了解 Sun 的实现可能有点欠缺.
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 - 以编程方式确定剩余时间或传输字节的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)