FTPSClient hangs on storeFile - file sent arrives with zero bytes
<p>I'm using <code>org.apache.commons.net.ftp.FTPSClient</code> for sending files to another server. But the program hangs after </p>

<pre><code>boolean stored = client.storeFile(fileName, is);
</code></pre>

<p>The file is sent but on the server it has zero bytes. </p>

<p>I tried sending the same file to the same server using <code>Filezilla</code> and it gets transferred with no problems, so I don't think this is a firewall issue. </p>

<p>I also made sure that my <code>InputStream</code> is reading the file by printing its contents. </p>

<p>Here's my code: </p>

<pre><code>FTPSClient client = new FTPSClient();
InputStream is = null;

client.connect(AppValues.ftpurl);
client.login(AppValues.ftpname, AppValues.ftppass);
is = new FileInputStream("C:\\Users\\path\\filename");
boolean stored = client.storeFile(fileName, is);
System.out.println("Stored? " + stored);
</code></pre>

<p>The Stored printout is never called, and the file arrives with zero bytes. </p>

<p>What am I missing? </p>