ftptask on nant 0.85
-
18-04-2021 - |
Domanda
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
Soluzione
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
Altri suggerimenti
You may use the WinSCP (free ftp client for windows) and integrate it through nant tag. I blogged about it here
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow