问题
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