VB example Delphi example Visual C++ ATL example C# example VB.NET example
There are two ways to send one or more files with the Xceed FTP Library. The first and simplest way to send one or more files is to use the XceedQuickFtp control. The second way is to use the XceedFtp control's properties and methods, which allow for more flexibility and interactivity. Both options are explained below.
When using the XceedQuickFtp control, there are no properties to set and no events that are triggered. All you need to do is to call the XceedQuickFtp control's SendFile or SendMultipleFiles methods.
To receive a file from an FTP server, perform the following steps. Put the XceedFtp control on a form, or instantiate it dynamically, then:
Specify the FTP server address to connect to. To do this, set the ServerAddress property.
Specify the username to login. Use the UserName property, which is 'Anynomous' by default.
Specify the username's password. Use the Password property, which is 'guest' by default.
Connect to the specified host. To do this, call the Connect method.
Once you are connected you can start sending files. Call the SendFile to send a single file, or call the SendMultipleFiles method to send multiple files using wildcards.
Disconnect from the FTP server. Do this by calling the Disconnect method.
Make sure that everything worked properly. To do this, use your language's error handling object or error handling capabilities. The Xceed FTP Library supports standard COM error handling functionality.
While you are connected, you can perform as many send, receive, listing or other FTP commands as needed.
Do you want the file to have a different filename when sent to the FTP server? If yes, see the SendingFile event and change the sRemoteFilename parameter.
Do you want to append the file you are uploading to a file that already exists on the FTP server? If yes, specify True for the SendFile method's bAppend parameter.
Is the FTP server listening on a port other than the usual TCP/IP port 21? If yes, then set the ServerPort property.
The FTP protocol supports "Accounts". Does your FTP server require you to specify an account? If yes, then set the AccountName property or write a handler for the AccountRequired event.