恢复文件传输以中途失败的文件传输 [英] Resume file transfer for a half way failed file transfer

查看:105
本文介绍了恢复文件传输以中途失败的文件传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此jsch库( http://www.jcraft.com/jsch/)在我的ColdFusion应用程序中.我的应用程序想要实现一种重试机制-如果文件传输中途失败,那么我想从上次中断的地方恢复(或继续)文件传输.使用此jsch库是否可以实现?

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?

推荐答案

只需重新连接并使用RESUME标志重新开始上传:

Just reconnect and start an upload again with RESUME flag:

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

RESUME标志将使部分远程文件的JSch查询大小并从此处重新开始传输.如果文件已经完全上传,则不会传输任何内容.

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.

这篇关于恢复文件传输以中途失败的文件传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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