<project name="FtpUpload" default="upload" basedir=".">
    <description>Uploads build results to the server</description>
    
  <target name="upload">

	  <ftp action="rmdir" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}">
	    <fileset>
	      <include name="repository"/>
	      <include name="apidocs"/>
	    </fileset>
	  </ftp>    
		
	  <ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}">
	    <fileset dir="${circle.artifacts}"/>
	  </ftp>    
  </target>
</project>

<project name="FtpUpload" default="upload" basedir=".">
  <description>Uploads build results to the server</description>
    
  <target name="upload">

	  <ftp passive="yes" action="delete" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" remotedir="/repository">
 	    <fileset>
              <include name="**"/>
            </fileset>
          </ftp>

	  <ftp passive="yes" action="rmdir" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" remotedir="/repository">
 	    <fileset>
              <include name="**"/>
            </fileset>
          </ftp>

	  <ftp passive="yes" action="delete" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" remotedir="/apidocs">
 	    <fileset>
              <include name="**"/>
            </fileset>
          </ftp>

	  <ftp passive="yes" action="rmdir" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" remotedir="/apidocs">
 	    <fileset>
              <include name="**"/>
            </fileset>
          </ftp>

	  <ftp passive="yes" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}">
	    <fileset dir="${circle.artifacts}"/>
	  </ftp>    
  </target>
</project>

Fix in FTP upload file (changes got magically lost).
Fix in FTP upload file (changes got magically lost).