2

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

Damir Arh
  • 17,637
  • 2
  • 45
  • 83
new coder
  • 313
  • 2
  • 24

2 Answers2

3

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

Damir Arh
  • 17,637
  • 2
  • 45
  • 83
  • The link to the library documentation gives a 404. – Nikolaos Georgiou Mar 04 '12 at 12:39
  • 1
    @NikolaosGeorgiou It looks like the project has been moved to [GitHub](https://github.com/davidalpert/NAntFTPTask). The only place I could find the docs currently is in the [task source code](https://github.com/davidalpert/NAntFTPTask/blob/master/Tasks/ftptask.cs). – Damir Arh Mar 04 '12 at 12:54
1

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