|
|
|
|
|
- Overview
- FTP
- How it works
- Use in WLanguage
- Relative path/Absolute path
- Secure FTP server: SFTP and FTPS
- 1. SFTP protocol
- 2. FTPS protocol
Manipulating files on an FTP server
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.
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. 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: - Connect to an FTP server (FTPConnect).
- 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.
- 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.
FTP functions cannot be used in the Android emulator. - You can connect to an FTP server:
- by passing all the necessary parameters to FTPConnect.
New in SaaSby manipulating a variable of type ftpConnection containing the various parameters of the FTP connection to be used. Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 2.
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
Related Examples:
|
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
|
|
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
|
|
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
|
|
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...)
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|