ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / FTP functions
  • FTPProxy and SOCKS5 protocol
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
FTPProxy (Function)
In french: FTPProxy
Specifies whether the communication functions that use FTP must go through a proxy to run their requests.
This function is only taken into account the next time a function that uses FTP is called.
Attention:
  • This function applies to the FTP protocol only (and not to FTPIS/FTPES/SFTP).
  • In Linux, Android and iOS, this function can only be used with the SOCKS5 protocol (ftpProxySOCKS5 constant).
Example
// Définit le proxy FTP
FTPProxy(ftpProxyUserTogether, "test", 2121, "test", "test")

// Ouvre la connexion
IDConnexion is int
IDConnexion = FTPConnect("montest.doc.com", "test", "test", 21, True, 20)
IF IDConnexion = -1 THEN
	Error(ErrorInfo(errFullDetails))
ELSE
	...
END
Syntax
FTPProxy(<Proxy type> [, <Proxy address> [, <Proxy port> [, <Username> [, <Password>]]]])
<Proxy type>: Integer constant
Type of the FTP proxy to use:
ftpProxyNoneAllows to cancel the use of the FTP proxy.
ftpProxyOpenFTP proxy requiring the "OPEN" command.
The following statements will be sent:
  • USER with the Proxy username
  • PASS with the Proxy password
  • OPEN in the following format: @<FTP server address>:<FTP server port>
  • USER with the FTP username
  • PASS with the FTP password
LinuxAndroidAndroid Widget iPhone/iPad This constant is not available.
ftpProxySiteFTP proxy requiring the "SITE" command.
The following statements will be sent:
  • USER with the Proxy username
  • PASS with the Proxy password
  • SITE in the following format: @<FTP server address>:<FTP server port>
  • USER with the FTP username
  • PASS with the FTP password
LinuxAndroidAndroid Widget iPhone/iPad This constant is not available.
ftpProxySOCKS5FTP proxy using the SOCKS5 protocol.
ftpProxyUserSeparateFTP proxy requiring the "USER" command and the "PASS" command separately.
The following statements will be sent:
  • USER with the Proxy username
  • PASS with the Proxy password
  • USER in the following format: <FTP username>@<FTP server address>:<FTP server port>
  • PASS with the FTP password
LinuxAndroidAndroid Widget iPhone/iPad This constant is not available.
ftpProxyUserTogetherFTP proxy requiring the "USER" command with user and password.
The following statements will be sent:
  • USER in the following format: <Proxy username>:<FTP username>@<FTP server address>:<FTP server port>
  • PASS in the following format: <Proxy Password>:<FTP Password>
LinuxAndroidAndroid Widget iPhone/iPad This constant is not available.
<Proxy address>: Optional character string
Address of the FTP proxy in the following format:
  • IP address in XXX.XXX.XXX.XXX format (e.g. 125.5.110.100).
  • URL containing the server name (www.windev.com for example). This syntax is recommended.
  • IP address returned by NetIPAddress.
<Proxy port>: Optional integer
Port number of the FTP proxy. This parameter is set to 21 if it is not specified.
<Username>: Optional character string
Authentication through the FTP proxy. If this parameter is an empty string ("" by default), no authentication is performed.
<Password>: Optional string or Secret string
Password for authentication through the proxy. This parameter is ignored if <Username> is an empty string ("").
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.
New in version 2025
AndroidAndroid Widget Secret strings are not available for this parameter in Android/Android widget applications.
Remarks

FTPProxy and SOCKS5 protocol

To use the SOCKS5 protocol with FTPProxy, use the ftpProxySOCKS5 constant to specify the type of proxy to be used.
CAUTION:
  • A SOCKS5 proxy cannot be used if FTP is configured to use WinInet (mode that uses Internet Explorer). This mode can be configured with the httpConfigureMode constant of FTPConfigure. Calling FTPProxy will cause a fatal error.
  • SOCKS5 proxies can only be used with FTP and SFTP. If a SOCKS5 proxy is configured, calling FTPConnect on a server via FTPES or FTPIS will cause a fatal error.
Example:
// On ne doit pas utiliser wininet pour avoir accès au proxy SOCKS5
FTPConfigure(ftpConfigureMode, 1)
// Les fonctions FTP utiliseront le proxy SOCKS5 
// à l'adresse 172.12.2.79:1080 avec les identifiants USER:PWD 
FTPProxy(ftpProxySOCKS5, "172.12.2.79",1080, "USER", "PWD")
// On se connecte au serveur FTP de test de rebex
nIDFTP is int = FTPConnect("ftp://test.rebex.net/", "demo", "password", 21)
IF nIDFTP = -1 THEN
	Error(ErrorInfo(errFullDetails))
ELSE
	Info("OK")
END
FTPDisconnect(nIDFTP)
// On enlève le proxy
FTPProxy(ftpProxyNone)
Business / UI classification: Business Logic
Component: wd300com.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/16/2025

Send a report | Local help