0

Is there a way to upload a file with ftp4j in append mode? I can't find any reference to that in the documentation or on google. Thank you!

Mark
  • 11,257
  • 11
  • 61
  • 97
Alberto M
  • 1,608
  • 1
  • 18
  • 42

2 Answers2

1

Starting from frp4j 1.6 you can use the append() method:

  • append(File)
  • append(File, FTPDataTransferListener)
  • append(String, InputStream, long, FTPDataTransferListener)

See: http://www.sauronsoftware.it/projects/ftp4j/api/it/sauronsoftware/ftp4j/FTPClient.html#append%28java.io.File%29

0

The FTPClient.upload(File file, long RestartAt) method can restart an upload. The parameter restartAt specifies the restart point (number of bytes already uploaded). Use isResumeSupported() to check if the server supports resuming of broken data transfers.

Giuseppe Cardone
  • 5,323
  • 2
  • 24
  • 30
  • what we need is something that would append to a file even if the new file is a smaller file. Eventually we changed the way we did this, so, thank you very much anyways :) – Alberto M Sep 14 '10 at 07:25
  • what is the difference between append and upload with restartAt param? – husayt Jul 30 '15 at 06:40
  • According to the documentation, append will, well, append the file to an existing remote file. upload with restartAt resumes an upload. So if you call append multiple times, the remote file will repeat the same content multiple times, If you call upload multiple times, you should end up with the same file server-side. I did not test this myself, so *caveat emptor*. – Giuseppe Cardone Jul 30 '15 at 09:16