我在FTPClient API中读到以下声明:
boolean storeUniqueFile(InputStream local)
Stores a file on the server using a unique name assigned by the server and taking input from the given InputStream.来源:http://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html#storeUniqueFile(java.io.InputStream)
如何知道服务器为文件分配的唯一名称或路径?以前有人用过这个API吗?
发布于 2014-02-25 13:53:11
最后,我没有找到任何方法来了解分配的文件名,因为它甚至不在FTP服务器的响应中。我的FTP服务器(在Ubuntu下为vsftpd 3.0.2 )用于storeUniqueFile命令,只需回答
226 Transfer complete.我没有更多的信息了。文件通常使用.1、.2等扩展名创建。如果我确信没有人同时使用ftp服务器,那么我可以在前后运行listFiles(),只需做一个区分。仅此而已:-
https://stackoverflow.com/questions/21991916
复制相似问题