ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / FTP functions
  • Overview
  • FTP
  • How it works
  • Use in WLanguage
  • Relative path/Absolute path
  • Secure FTP server: SFTP and FTPS
  • 1. SFTP protocol
  • 2. FTPS protocol
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Manipulating files on an FTP server
Overview
FTP (File Transfer Protocol) is a protocol for transferring files from one computer to another. This protocol allows you to exchange files over TCP/IP or the Internet.
On the Internet, thousands of file servers can be accessed via FTP. FTP servers host shareware or freeware software accessible to the public.
WINDEV and WEBDEV include several WLanguage functions for managing files on an FTP server from your applications or websites.
FTP

How it works

  • In theory, you cannot connect to an FTP server without an FTP account and a password. Only users with an account and a password can access the server.
  • However, most public FTP servers allow you to log in anonymously. In this case, you will need to enter your email address as your password.
To download files from an FTP server, simply access as an "anonymous user".
To upload files to an FTP server server (e.g. to send HTML pages to your website), you need to enter a username and a password.
Use in WLanguage
WINDEV, WEBDEV and WINDEV Mobile include a series of WLanguage functions for manipulating files on an FTP server.
To manipulate files on an FTP server, follow these steps:
  1. Connect to an FTP server (FTPConnect).
  2. Send and retrieve files (according to the connection mode).
    For a passive connection, the WINDEV application or WEBDEV website must request authorization from the FTP server to manipulate the files on the FTP server. You can also:
    • get the details of the files located on an FTP server (attributes, size, etc.)
    • manipulate files on an FTP server: create or delete files, etc.
    • list the files of a directory on the FTP server and run a procedure for each file found.
  3. Disconnect from the FTP server (FTPDisconnect).
Remarks:
  • You need to install the TCP/IP communication protocol and define an IP address.
  • An FTP server must be installed and configured on one of the computers used for the transfer.
  • Android FTP functions cannot be used in the Android emulator.
  • You can connect to an FTP server:
Relative path/Absolute path
Relative and absolute paths are very important concepts in an application that handles files via FTP.
  • A path beginning with a slash is considered an absolute path. This path is relative to the root of the FTP server (server-specific parameter).
    e.g.: /pub/user/FIONA
  • If the path does not begin with a slash, it is considered a relative path, i.e. the path relative to the current directory on the FTP server. This current directory can be obtained or changed using FTPCurrentDir.
When connecting to an FTP site, the initial directory (the "base directory" of the user) is not necessarily found at the root of the FTP server. Therefore, we recommend that you use relative paths.
Secure FTP server: SFTP and FTPS
AndroidAndroid Widget There are different types of secure connection:
  • FTPIS: FTP secured using SSL with implicit encryption.
  • FTPES: FTP secured using SSL with explicit encryption.
  • SFTP: FTP secured using an SSH tunnel.
To use one of these connection modes, simply use FTPConnect and specify the desired mode.
AndroidAndroid Widget

1. SFTP protocol

SFTP is the acronym for "Secure File Transfer Protocol". This protocol is based on an SSH tunnel (secure SSH connection).
The symmetric encryption algorithms supported are: 3DES, Blowfish, AES and APRCFOUR.
This protocol is used by the Unix and Linux servers.
AndroidAndroid Widget

2. FTPS protocol

FTPS is the acronym for "File Transfer Protocol Secure". Communication is secured by the SSL protocol.
The symmetric encryption algorithms supported are: 3DES, Blowfish, AES and APRCFOUR.
This protocol is used by the IIS web servers.
Note: The certificate of the certification authority must be saved in the local certificate registry.
Example:
  • "XX" has generated a certificate for the "Doc" server: "xx-DocPC".
  • The "xx-DocPC" certificate is used for configuring the server.
  • On the other hand, the certificate certifying "XX" (let's call it the "XX certificate") must be saved on the client computer.
Most certification authorities are already registered in the client's operating system.
However, if a specific authority creates a certificate, and the base certificate is not registered on the client computer, the error "The certificate could not be verified" will appear.
Related Examples:
The FTP functions Unit examples (WINDEV): The FTP functions
[ + ] Using the main FTP functions of WINDEV:
- Connect to a FTP server
- List the files and directories found on the FTP server
- Retrieve the files found on the FTP server
- Disconnect from a FTP server
The FTP functions Unit examples (WEBDEV): The FTP functions
[ + ] This example presents the main FTP functions of WEBDEV and it allows you to:
- Connect to an FTP server
- List the files and directories found on the FTP server
- Retrieve the files found on the FTP server
- Disconnect from an FTP server
WM FTP Client Cross-platform examples (WINDEV Mobile): WM FTP Client
[ + ] This example is an FTP Client for Android and iOS.
It explains how to interact with an FTP server via the FTP functions of WLanguage.
It is used to:
- Rename files
- Delete files
- Create folders
- Download files
- Send files to the server
WD FTP File Transfer Complete examples (WINDEV): WD FTP File Transfer
[ + ] WD FTP file transfer

This example is a full FTP client allowing you to store several FTP servers. Then, you have the ability to perform multi-file transfers from the local computer to the server or from the FTP server to the local computer. To do so, we are using the standard functions of WLanguage (FTPConnect, etc...)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/25/2025

Send a report | Local help