-3

I am using a TFTPClient example to copy a file from local disk and create a file on tftp server with a new name but same contents I am sending the input stream to

tftpClient.sendFile(String filename, int mode, InputStream input,
                     InetAddress host, int port) method

the file with fileName is getting created on the server but with size 0.

Some more things:

  • I have setup tftp server on windows8 64 bit
  • able to put the file on tftp server from cmd
  • I have TFTP Client enabled
  • I have turned off firewall
  • and I have read the lines of input stream and it actually contains data.

Please suggest a solution.

user6666833
  • 21
  • 1
  • 4
  • So the input is zero length, or you have already consumed it before calling this method. – user207421 Aug 02 '16 at 09:24
  • **Do not post code in comments.** You can see for yourself that it is completely illegible. Edit it into your question. – user207421 Aug 02 '16 at 10:22
  • @EJP i have modified the question as i have checked that the inputstream is containing data but strill tftp server is creating only empty file not taking inputstream data – user6666833 Aug 02 '16 at 11:21
  • Your question is futile without the code. If you've read the lines of the input you have consumed it, as I said in my first comment. – user207421 Aug 02 '16 at 22:12

1 Answers1

0

I got the solution the issue was due to jar file there were bugs in tftp client early release that it drops last data package the bug fixed in version 3 of commons-net. Took the new jar issue resolved

user6666833
  • 21
  • 1
  • 4