Question

how do u upload files to a fpt server in nant? i used the following code but it says that attribute server is unknown.

<ftp server="ftp.server.name.com"
            userid="user"
            password="user123"
            remotedir="/the_dir_in_remote_file">
            <fileset dir="dir_to_be_moved"/>
        </ftp>

i use the ftptask library i cant figure out what is wrong..please help thanx

Was it helpful?

Solution

You might find the library documentation helpful. The server, username (not userid), password and remotedir belong to a separate connection tag which you should reference in the ftp tag:

<connection id="ftpserver" 
            server="ftp.server.name.com" 
            username="user" 
            password="user123" />
<ftp connection="ftpserver" >
  <put remotedir="the_dir_in_remote_file">
    <include name="dir_to_be_moved\**" />
  </put>
</ftp>

The above snippet works with the latest version of NAnt and FTPTask

OTHER TIPS

You may use the WinSCP (free ftp client for windows) and integrate it through nant tag. I blogged about it here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top