title: ANT FTP upload file: 425 Unable to build data connection: Connection timed out
body: <p>I try to automate the deployment of a small site via ANT FTP. I use Win7-64bit and what started as an easy task gets more and more a challenge.
  I first figured out that I had to install additional classes which I did. <code>commons-net-3.0.1.jar, jakarta-oro-2.0.8.jar</code> Then I had to deactivate parts of my firewall which I also did. <code>netsh advfirewall set global StatefulFTP disable</code> But even now it is not working.</p>
  
  <p>But step by step, that is the <strong>task</strong>:</p>
  
  <pre><code>&lt;target name="ftp" description=""&gt;
  &lt;ftp server="${ftp.server}"
       userid="${ftp.user}"
       password="${ftp.password}"
       verbose="yes"&gt;
      &lt;fileset dir=".."&gt;
          &lt;include name="maintenance.php"/&gt;
      &lt;/fileset&gt;
  &lt;/ftp&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>Thats the <strong>result</strong>:</p>
  
  <pre><code>ftp:
    [ftp] sending files
    [ftp] transferring C:\xampp\htdocs\maintenance.php
  
  BUILD FAILED
  C:\xampp\htdocs\xdf\build.xml:32: could not put file: 425 Unable to build data con
  nection: Connection timed out
  
  
  Total time: 3 minutes 10 seconds
  </code></pre>
  
  <p>What the heck did I do wrong?</p>
  
  <p><strong>UPDATE found a working example for Zend auto-sync seams ANT 1.8.3 has new features:</strong></p>
  
  <pre><code>&lt;property name="ftp.server" value="ftp.foo.bar"/&gt;
  &lt;property name="ftp.user" value="foor"/&gt;
  &lt;property name="ftp.password" value="bar"/&gt;
  &lt;property name="ftp.basedir" value=""/&gt;
  &lt;property name="ftp.verbose" value="yes"/&gt;
  
  &lt;target name="ftp-upload" description="Synchronise to FTP"&gt;
          &lt;!-- Create temp folder --&gt;
      &lt;tempfile prefix="ant-epp-" destdir="${java.io.tmpdir}" property="temp.file"/&gt;
      &lt;mkdir dir="${temp.file}"/&gt;
  
          &lt;!-- Move, rename, upload, delete 'maintenance.php' --&gt;
      &lt;copy file="docs/hosting/maintenance.php" tofile="${temp.file}/index.php" /&gt;
      &lt;ftp server="${ftp.server}"
              userid="${ftp.user}"
              password="${ftp.password}"
              remotedir="${ftp.basedir}/public"
              passive="yes"
              binary="yes"
              verbose="${ftp.verbose}"&gt;
          &lt;fileset dir="${temp.file}"&gt;
              &lt;include name="index.php" /&gt;
          &lt;/fileset&gt;
      &lt;/ftp&gt;
      &lt;delete dir="${temp.file}" /&gt;
  
          &lt;!-- Remove 'application' &amp; Reupload --&gt;
      &lt;ftp action="del" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}"
              remotedir="${ftp.basedir}/application" passive="yes" binary="yes" verbose="${ftp.verbose}"&gt;
          &lt;fileset&gt;
              &lt;include name="**" /&gt;
          &lt;/fileset&gt;
      &lt;/ftp&gt;
      &lt;ftp action="rmdir" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}"
              remotedir="${ftp.basedir}/application" passive="yes" binary="yes" verbose="${ftp.verbose}"&gt;
          &lt;fileset&gt;
              &lt;include name="**" /&gt;
          &lt;/fileset&gt;
      &lt;/ftp&gt;
      &lt;ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}"
              remotedir="${ftp.basedir}/application" passive="yes" binary="yes" verbose="${ftp.verbose}"&gt;
          &lt;fileset dir="application" /&gt;
      &lt;/ftp&gt;
  
          &lt;!-- Replace 'index.php' --&gt;
      &lt;ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}"
              remotedir="${ftp.basedir}/public" passive="yes" binary="yes" verbose="${ftp.verbose}"&gt;
          &lt;fileset dir="public"&gt;
              &lt;include name="index.php" /&gt;
          &lt;/fileset&gt;
      &lt;/ftp&gt;
  &lt;/target&gt;
  </code></pre>