FTP - way to programatically determine time remain

2019-05-05 07:14发布

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.

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

Thanks in advance!

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.

2条回答
来,给爷笑一个
2楼-- · 2019-05-05 07:31

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

查看更多
成全新的幸福
3楼-- · 2019-05-05 07:42

Some FTP frameworks for Java support progress monitoring. Since I only started looking at these a few days ago, I can't tell you whether this suits your purpose.

There's a review of the different frameworks available here :

http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html?page=1

查看更多
登录 后发表回答