ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / FTP functions
  • Example 1: Anonymous connection
  • Example 2: Passive connection
  • Example 3: Connecting to an FTP server via a connection window
FTPConnect (Example)
Example 1: Anonymous connection
WINDEVWEBDEV - Server codeReports and QueriesWindowsJavaUser code (UMC)Ajax This example is used to establish an anonymous connection to the FTP server identified by its IP address. The port used is the default port (21) and the password sent to the server corresponds to the default email address of the current computer.
nConnection is int
nConnection = FTPConnect("192.108.10.2")
Example 2: Passive connection
WINDEVWEBDEV - Server codeReports and QueriesWindowsJavaUser code (UMC)Ajax This example performs a passive connection to the FTP account named "SMITH" on the "ftp.cdrom.com" FTP server. This connection is performed on port 2001.
nConnection is int
nConnection = FTPConnect("ftp.cdrom.com", "Smith", "Password", 2001, True)
Example 3: Connecting to an FTP server via a connection window
WINDEVWEBDEV - Server codeReports and QueriesWindowsJavaUser code (UMC)Ajax This example allows the user to connect to an FTP server via a connection window. This window allows the user to choose the connection parameters.
The code below corresponds to the code of the CONNECT button.
// Open the connection
IF gbAnonymous = False THEN
// Named connection
IF gbAdvanced = False THEN
// Standard setting
gnConnectionID = FTPConnect(gsFTP_Address, gsUser_Name, gsUser_Pwd)
ELSE
// Advanced setting
gnConnectionID = FTPConnect(gsFTP_Address, gsUser_Name, ...
gsUser_Pwd, gnPort_Number, bType, gnTimeout)
END
ELSE
// Anonymous connection
IF gbAdvanced = False THEN
// Standard setting
gnConnectionID = FTPConnect(gsFTP_Address)
ELSE
// Advanced setting
gnConnectionID = FTPConnect(gsFTP_Address, "", "", gnPort_Number, bType, gnTimeout)
END
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help