Resume file transfer for a half way failed file transfer

微笑、不失礼 提交于 2019-12-08 03:33:28

问题


I am using this jsch library ( http://www.jcraft.com/jsch/ )in my ColdFusion application. My application wants to implement a retry mechanism - if a file transfer fails half way through then I want to resume (or continue) the file transfer from where it left off. Is this possible to achieve using this jsch library?


回答1:


Just reconnect and start an upload again with RESUME flag:

channelSftp.put(src, dst, ChannelSftp.RESUME);

The RESUME flag will make JSch query size of a partial remote file and restart the transfer from there. If the file is already uploaded completely, it transfers nothing.



来源:https://stackoverflow.com/questions/47332313/resume-file-transfer-for-a-half-way-failed-file-transfer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!