reference : http://be2u.tistory.com/45
commons-net-1.4.1.jar Download URL : http://abraxas73.springnote.com/pages/393486?print=1
jakarta-oro-2.0.8.jar Download URL : http://www.docjar.com/jar/jakarta-oro-2.0.8.jar
build.xml
<!--FTP Delete--> <target name="delete">
<echo meesage="서버의 파일을 삭제 합니다."/>
<ftp server="${server}"
port="${port}"
remotedir="${remotedir}"
userid="${userid}"
password="${userpw}"
action="del">
<fileset>
<include name="${file}"/>
</fileset>
</ftp>
</target>
<!--FTP Delete and FTP Upload--> <target name="all">
<antcall target="delete" />
<antcall target="upload" />
</target>
</project>
commons-net-1.4.1.jar Download URL : http://abraxas73.springnote.com/pages/393486?print=1
jakarta-oro-2.0.8.jar Download URL : http://www.docjar.com/jar/jakarta-oro-2.0.8.jar
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="ftpUpload" default="all" basedir="."> <!--FTP 정보에 대한 설정--> <property name="server" value="***.***.***.***" />
<property name="port" value="**" />
<property name="remotedir" value="/public_html/******" />
<property name="userid" value="******" />
<property name="userpw" value="******" />
<property name="folder" value="C:\" />
<property name="file" value="TempFile.data" /> <!--실행시에 출력되는 echo--> <echo message="올라간 주소 ${server}/${userid}/******/${file}" />
<!--FTP Upload-->
<target name="upload">
<echo meesage="서버에 파일을 업로드 합니다."/>
<ftp server="${server}"
port="${port}"
remotedir="${remotedir}"
userid="${userid}"
password="${userpw}"
binary="yes"
verbose="yes">
<fileset dir="${folder}">
<include name="${file}"/>
</fileset>
</ftp>
</target>
<!--FTP Download--> <target name="download"> <ftp server="${server}" port="${port}" passive="yes"
remotedir="${remotedir}"
action="get"
userid="${userid}" password="${userpw}"
depends="yes" verbose="yes" >
<fileset dir="${folder}">
<include name="${file}"/>
<include name="${file}"/>
</fileset>
</ftp>
</target>
<project name="ftpUpload" default="all" basedir="."> <!--FTP 정보에 대한 설정--> <property name="server" value="***.***.***.***" />
<property name="port" value="**" />
<property name="remotedir" value="/public_html/******" />
<property name="userid" value="******" />
<property name="userpw" value="******" />
<property name="folder" value="C:\" />
<property name="file" value="TempFile.data" /> <!--실행시에 출력되는 echo--> <echo message="올라간 주소 ${server}/${userid}/******/${file}" />
<!--FTP Upload-->
<target name="upload">
<echo meesage="서버에 파일을 업로드 합니다."/>
<ftp server="${server}"
port="${port}"
remotedir="${remotedir}"
userid="${userid}"
password="${userpw}"
binary="yes"
verbose="yes">
<fileset dir="${folder}">
<include name="${file}"/>
</fileset>
</ftp>
</target>
<!--FTP Download--> <target name="download"> <ftp server="${server}" port="${port}" passive="yes"
remotedir="${remotedir}"
action="get"
userid="${userid}" password="${userpw}"
depends="yes" verbose="yes" >
<fileset dir="${folder}">
<include name="${file}"/>
<include name="${file}"/>
</fileset>
</ftp>
</target>
<!--FTP Delete--> <target name="delete">
<echo meesage="서버의 파일을 삭제 합니다."/>
<ftp server="${server}"
port="${port}"
remotedir="${remotedir}"
userid="${userid}"
password="${userpw}"
action="del">
<fileset>
<include name="${file}"/>
</fileset>
</ftp>
</target>
<!--FTP Delete and FTP Upload--> <target name="all">
<antcall target="delete" />
<antcall target="upload" />
</target>
</project>
댓글
댓글 쓰기