|
- Overview
- The 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
The FTP (File Transfer Protocol) is a protocol used to transfer files from a site to another remote site. This protocol is used to exchange files by TCP/IP or Internet. Several thousands of file servers can be accessed by FTP on Internet. 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. Versions 15 and later New in version 15 Versions 18 and later New in version 18 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 site, you must follow these rules: - Connecting to an FTP server (FTPConnect).
- Sending and retrieving files (according to the connection mode). For a passive connection, the WINDEV application or the WEBDEV site must request the authorization from the FTP server before each file operation on the server. You can also:
- find out the characteristics of files found on an FTP server: attributes, size, ...
- handle the files found on an FTP server: creation, deletion, ...
- list the files of a directory found on the FTP server by running a procedure used to perform a process for each file found.
- Closing 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: The 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 starting with a slash is considered as being an absolute path: it is the path in relation to the root of the FTP server (parameter specific to the server).
ex: /pub/user/FLO - 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 "home directory" of the user) is not necessarily found at the root of the FTP server. Therefore, we recommend that you use relative paths. Versions 18 and laterSecure FTP server: SFTP and FTPS protocols New in version 18Secure FTP server: SFTP and FTPS protocols 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
|
|
Mobile (WINDEV Mobile): Pocket FTPClient
[ + ] This example is an FTP client for Pocket PC. This example enables you to view the content of an FTP server. It can also used to download files, to rename them or to delete them.
|
|
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…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |