|
|
|
|
|
- Overview
- FTP
- Use convention
- Principle
- Relative path/Absolute path
- Secure FTP server: SFTP and FTPS protocols
- 1. SFTP protocol
- 2. FTPS protocol
Handling files on an FTP server
FTP (File Transfer Protocol) is a protocol for transferring files from one site to another. This protocol allows you to exchange files via TCP/IP or the Internet. On the Internet, thousands of file servers can be accessed via FTP. These servers propose shareware or freeware to the public. WINDEV and WEBDEV include several WLanguage functions allowing you to manage files on an FTP server from your applications or sites.
Use convention - In theory, you cannot connect to an FTP site without an FTP account and a password. Only a user with an account and a password can connect to this site.
- Practically, all the servers found on Internet have an Anonymous account. The password of this account is not implemented but an email address will be requested.
To download the files found on an FTP server, all you have to do is connect as "anonymous user". To upload files to an FTP server (to send HTML pages to your Web site for example), a non-anonymous account and a password are required. To handle the files found on an FTP server from a WINDEV application or from a WEBDEV website, you must follow these rules: - Connecting to an FTP server (FTPConnect).
- Send and retrieve files (according to the connection mode). For a passive connection, the WINDEV application or the WEBDEV website must request the authorization from the FTP server before each file operation on the server. You can also:
- get the characteristics 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 found on the FTP server by running a procedure used to perform a process for each file found.
- Close the connection to the server (FTPDisconnect).
Caution: - The TCP/IP communication protocol must be installed and an IP address must be defined.
- An FTP server must be installed and configured on one of the computers used to perform the transfer.
- Caution: FTP functions cannot be used in the Android emulator.
Relative path/Absolute path The notions of relative path and absolute path are very important in an FTP application. - A path beginning with a slash is considered an absolute path: this is the path relative to the FTP server root (server-specific parameter).
ex: /pub/user/FIONA - A path not starting with a slash is considered as being a relative path, which means a path given in relation to the current directory. This current directory can be returned or modified by 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 protocols
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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|