有人知道如何检测本机FTP插件的下载/上传方法中的故障吗??? 阅读文档时,它表示该函数返回一个可观察值,其中一个参数表示完成百分比。 一旦该值达到1,则表示传输完成。但这并没有说明失败。 即使我将传输放在try / catch中,它也不会触发。...
例如:
try
{
this._ftp.download(localfile, remotefile).subscribe( (value) => {
if ( value == 1)
{ alert("transfer completed !"); }
});
}
catch ( Error ) {
alert ("Error"); // Never triggered
}
谢谢,抱歉我的英语!
答案 0 :(得分:0)
仔细查看Logcat上的日志。如果可能,请向我们显示结果。
答案 1 :(得分:0)
这是LogCat中的部分日志。您可以查看如何开始,发送已传送的“值”以及结束。在该文件之后,在队列中,还有一个我已重命名的文件。调用了下载功能,但是没有错误,并且您可以看到,logcat中没有任何内容。...
2019-03-20 21:31:48.489 13324-24078/es.hazi.filecopy I/CDVFtpTransferListener: Transfer started
2019-03-20 21:31:48.532 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=5760, percent=0.0329912
2019-03-20 21:31:48.536 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=14400, percent=0.08247801
2019-03-20 21:31:48.572 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=20160, percent=0.11546921
2019-03-20 21:31:48.579 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=28800, percent=0.16495602
2019-03-20 21:31:48.581 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=43200, percent=0.24743402
2019-03-20 21:31:48.611 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=46080, percent=0.2639296
2019-03-20 21:31:48.613 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=57600, percent=0.32991204
2019-03-20 21:31:48.617 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=100800, percent=0.577346
2019-03-20 21:31:48.651 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=103680, percent=0.5938417
2019-03-20 21:31:48.653 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=115200, percent=0.6598241
2019-03-20 21:31:48.661 13324-24078/es.hazi.filecopy D/CDVFtpTransferListener: Transferred, totalSize=174592, curSize=174592, percent=1.0
2019-03-20 21:31:48.751 13324-24078/es.hazi.filecopy I/CDVFtpTransferListener: Transfer completed
2019-03-20 21:31:48.838 13324-13329/es.hazi.filecopy I/zygote64: Do partial code cache collection, code=249KB, data=178KB
2019-03-20 21:31:48.840 13324-13329/es.hazi.filecopy I/zygote64: After code cache collection, code=249KB, data=178KB
2019-03-20 21:31:48.840 13324-13329/es.hazi.filecopy I/zygote64: Increasing code cache capacity to 1024KB
2019-03-20 21:31:53.658 13324-13324/es.hazi.filecopy D/CordovaActivity: Paused the activity.