Note that there are some explanatory texts on larger screens.

plurals
  1. POFTP error while downloading/uploading with ftp4j library in java application
    text
    copied!<p>I want to download a file in java application and when I try it, it creates the file on my hard drive but then fails to download it completely. I am using the ftp4j library to do it.</p> <pre><code>import it.sauronsoftware.ftp4j.*; public class Main { public static void main (String args[]){ FTPClient client = new FTPClient(); try{ client.connect("ftp.myaddress.comlu.com"); client.login("username", "password"); System.out.println("Connection created"); client.download("public_html/ZScreen.png", new java.io.File("d:/xxx/ZScreen.png")); System.out.println("Download successful"); client.disconnect(true); } catch (Exception FTPException){ System.out.println("Shit hit the fan"); } } } </code></pre> <p>I always get the Connection created and Shit hit the fan. Also, there is a file created on my hard drive but it's size is 0 bytes.</p> <p>This is the stack race </p> <pre><code>Connection created java.net.SocketException: Connection reset Shit hit the fan at java.net.SocketInputStream.read(SocketInputStream.java:189) at java.net.SocketInputStream.read(SocketInputStream.java:121) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) at sun.nio.cs.StreamDecoder.read0(StreamDecoder.java:126) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:112) at java.io.InputStreamReader.read(InputStreamReader.java:168) at it.sauronsoftware.ftp4j.NVTASCIIReader.readLine(NVTASCIIReader.java:105) at it.sauronsoftware.ftp4j.FTPCommunicationChannel.read(FTPCommunicationChannel.java:142) at it.sauronsoftware.ftp4j.FTPCommunicationChannel.readFTPReply(FTPCommunicationChannel.java:187) at it.sauronsoftware.ftp4j.FTPClient.openPassiveDataTransferChannel(FTPClient.java:3538) at it.sauronsoftware.ftp4j.FTPClient.openDataTransferChannel(FTPClient.java:3473) at it.sauronsoftware.ftp4j.FTPClient.download(FTPClient.java:3302) at it.sauronsoftware.ftp4j.FTPClient.download(FTPClient.java:3213) at it.sauronsoftware.ftp4j.FTPClient.download(FTPClient.java:3078) at Main.main(Main.java:9) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload