URL Connection (FTP) in Java - Simple Question

后端 未结 3 1748
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-22 02:17

I have a simple question. I\'m trying to upload a file to my ftp server in Java.

I have a file on my computer, and I want to make a copy of that file and upload it. I t

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-22 02:43

    FTP usually opens another connection for data transfer. So I am not convinced that this approach with URLConnection is going to work. I highly recommend that you use specialized ftp client. Apache commons may have one.

    Check this out http://commons.apache.org/net/api/org/apache/commons/net/ftp/FTPClient.html

提交回复
热议问题