[英]Download part of file from FTP server using `FTPClient`
Is it possible to download only a part of a file from my FTP server using FTPClient ? 是否可以使用FTPClient从我的FTP服务器下载文件的仅一部分? This part should by specified by two
long
values m
and n
meaning "starting from byte m
untill byte n
. 这部分应该由两个
long
值m
和n
来指定,意思是“从字节m
开始直到字节n
。
Is such a thing actually possible using the FTP protocol? 使用FTP协议实际上可以做到这一点吗?
Using the ftp4j library you can do the following: 使用ftp4j库,您可以执行以下操作:
client.download("remoteFile.ext", new java.io.File("localFile.ext"), 1056);
The documentation describes this method as the following: 文档将这种方法描述如下:
This one resumes the download operation starting from the 1056th byte of the file.
这将从文件的第1056个字节开始恢复下载操作。 The first byte transferred will be the 1057th.
传输的第一个字节为1057。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.