Ant FTP 任务上传文件至 1024 字节的倍数
我正在运行一个 Ant 目标,其中包含以下内容:
<ftp action="send"
server="${ftp.server}"
remotedir="${ftp.remotedir}"
userid="${ftp.userid}"
password="${ftp.password}"
systemTypeKey="WINDOWS"
binary="no"
verbose="yes">
<fileset dir="${dist.dir}">
<includesfile name="${temp.dir}/changedListText.txt"/>
</fileset>
</ftp>
“changedListText.txt”是要上传的以换行符分隔的文件列表。我上传的所有文本文件的大小最终都为零。此外,我上传的所有二进制文件的大小与我的本地计算机不匹配。我认为拆分文本和二进制文件会有所帮助,但显然没有。
我可以找到有关 Ant FTP 任务的宝贵文档,并且就 Verbose 的报告而言,上传过程中似乎没有任何错误。
编辑:我现在看到它只上传 1024 字节的整个块。我的文本文件很小,因此它们最终会向下舍入为零。
I'm running an Ant target which contains this:
<ftp action="send"
server="${ftp.server}"
remotedir="${ftp.remotedir}"
userid="${ftp.userid}"
password="${ftp.password}"
systemTypeKey="WINDOWS"
binary="no"
verbose="yes">
<fileset dir="${dist.dir}">
<includesfile name="${temp.dir}/changedListText.txt"/>
</fileset>
</ftp>
"changedListText.txt" is a newline-delimited list of files to upload. All text files I upload end up having a size of zero. Also, all binary files I upload have a size that doesn't match my local machine's. I thought splitting the text and binary files would help, but apparently it didn't.
I can find precious little documentation on the Ant FTP task, and as far as Verbose is reporting, there don't appear to be any errors during the upload.
EDIT: I see now that it's only uploading whole chunks of 1024 bytes. My text files are small, so they're ending up rounding down to zero.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能使用Apache Commons Net 3.0。更改为 1.4.1 就可以了。不要忘记删除3.0 jar。
jar 文件可以从以下位置下载: http://commons.apache.org/net/download_net.cgi
Your probably using Apache Commons Net 3.0. Change to 1.4.1 and it will work. Don't forget to remove the 3.0 jar.
The jar file can be downloaded from: http://commons.apache.org/net/download_net.cgi