ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV, WEBDEV and WINDEV Mobile 2025 feature!
This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / FTP functions
  • Properties specific to the description of variables of type ftpConnexion
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
ftpConnexion (Variable type)
In french: ftpConnection
The type ftpConnexion type is used to define all the advanced characteristics of an FTP connection. This type of variable can be used:
You can define and change the characteristics of this type of variable using different WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Upload a backup to an FTP server
Backup_Doc is hBackupDescription
Save_Doc.Description = "SaveWithRight"
Backup_Doc.WithIndex = True
Backup_Doc.Destination = "Back/RightBackup"
Save_Doc.Source = "Anonymization/*"

Sauvegarde_Doc.Ftp.Connexion.Serveur = "chorizo-2k8"
Save_Doc.Ftp.Connection.User = "TT"
Backup_Doc.Ftp.Connection.Password = "TT"
Save_Doc.Ftp.Connection.PortNumber = 22
Save_Doc.Ftp.Connection.ConnectionType = ftpModeActive
Backup_Doc.Ftp.DestinationPath = "/tmp"

// Save backup 
HBackup(MyConnection, Backup_Doc)
Properties

Properties specific to the description of variables of type ftpConnexion

The following properties can be used to manipulate a variable of type ftpConnexion:
Property nameType usedEffect
PrivateKeyCharacter stringName and path of file corresponding to the private key used during a connection in SFTP mode. This file must have been generated in OpenSSH format.
By default, the secure connection uses authentication via <Utilisateur> / <MotDePasse>.
ConnectionTypeentierType of connection to perform:
  • ftpModeActif Active connection to FTP server.
    When transferring files, the client starts the transfer. This type of connection may be refused by some protected FTP servers.
  • ftpPassiveMode (Default): Passive connection to FTP server (PASV mode).
    When transferring files, the server takes the initiative for the transfer. This type of connection is used to step over some "firewalls".
    Note: If the connection to the server is in IPV6, then the connection will be made in extended passive mode (because passive mode does not support IPV6)..
  • ftpPassiveExtendedMode Extended passive connection to FTP server (EPSV mode).
    When transferring files, the server takes the initiative for the transfer. This type of connection is used to step over some "firewalls".
    If the server does not support the extended passive mode (the FEAT command is sent to the server to find out the capacity), the connection is crippled in simple passive mode.
    Limitations: This mode is not supported when using the Windows "wininet" module (see function FTPConfigure): the connection is made in ftpModePassive.
  • ftpPassiveModeIgnoreIP Passive connection to FTP server (PASV mode).
    When transferring files in passive mode, the server sets the port and IP address for data transfer. With this parameter, only the port is taken into account. The IP address is ignored. This type of connection allows the use of FTP servers that return non-routable IP addresses but are reachable via the connection IP address.
    Limitation: This mode is not supported when using the Windows "wininet" module (see function FTPConfigure): the connection is made in ftpModePassive.
PasswordCharacter string or secret string User password, to identify the user on the FTP server. This password corresponds to:
  • the specified <Password> if this parameter is not an empty string (""),
  • the email address of the user if <Username> is not specified or it is equal to an empty string (""),
  • an empty string ("") if this parameter is not specified and if <Username> does not correspond to an empty string ("").
Note: If the password contains special characters, it may be necessary to convert it to UTF8 using the StringToUTF8 function.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "Ansi or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
PortNumberentierNumber of the port on which the server will be run. This parameter is given by the administrator of FTP server.
By default:
  • for a non-secure connection, this port is port 21.
  • for a secure connection in FTPS mode, this port is port 990.
  • for a secure connection in FTPES mode, this port is port 21.
  • for a secure connection in SFTP mode, this port is port 22.
PrivateKeyPasswordCharacter string or secret string Password of file containing the private key used during a connection in SFTP mode.
If Unicode is used for executing strings ("Unicode" tab of current configuration), the password must not be enclosed in quotation marks. It must be in a string variable declared in ANSI format.
If this parameter is not specified, the secure connection uses authentication via <Utilisateur> / <MotDePasse>.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "Ansi or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
ServerCharacter stringName of FTP server ("ftp.cdrom.com" for example) or IP address of FTP server ("192.54.12.8" for example).
This property defines the protocol used:
  • if the server name starts with "ftp://", the connection is established in non-secure mode.
  • if the server name starts with "ftps://", the connection is established in secure mode according to the FTPS protocol (FTP secured by SSL with implicit encryption).
  • if the server name starts with "ftpes://", the connection is established in secure mode according to the FTPES protocol (FTP secured by SSL with explicit encryption).
  • if the server name starts with "sftp://", the connection is established in secure mode via a SSH channel according to the SFTP protocol.
TimeoutentierNumber of seconds after which the request for connecting to the FTP server is canceled (20 by default).
This timeout applies to all FTP operations performed on this connection. If no response is received from the server within the specified time, the connection fails.
This property can correspond to:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • the duration in a readable format (e.g., '1s').
UserCharacter stringName of user attempting to perform a named connection (user authentication on FTP server).
If this property matches an empty string (""), the connection will be anonymous.
Minimum version required
  • Version 2025
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/06/2024

Send a report | Local help