|
|
|
|
- Reminder about the FTP protocol
- FTP commands
- Example: Getting a TEST file found in the AAA library of an AS/400:
- Use conditions
FTPCommand (Function) In french: FTPCommande Sends a specific FTP command to a server. Caution: This function is not available during a connection in mode: - FTPIS: FTP secured according to the SSL protocol with implicit encryption.
- FTPES: FTP secured according to the SSL protocol with explicit encryption.
- SFTP: FTP secured by a SSH channel.
Remarks Reminder about the FTP protocol This protocol is using 2 communication channels: - A command channel: is used to send commands and to receive error or success messages,
- A data channel used to transfer the data associated with the command.
FTP commands All the commands that can be used on an FTP server are found in the RFC989 specification. This document is available on the Internet (use a search engine and search for the RFC959 reference). Some standard examples: Uploading and downloading files with FTPCommand 1. Downloading files:
Réponse, ResData sont des chaînes FTPCommande(<Identifiant de la connexion>, ... "RETR " + <Nom Fichier serveur>, ... Réponse, ResData, <Mode de transfert>) // ResData contient le fichier
2. Uploading files:
Réponse, ResData, DataRésultat sont des chaînes // ResData contient le fichier à envoyer FTPCommande(<Identifiant de la connexion>,... "STOR " + <Nom Fichier serveur>, ... Réponse, DataRésultat, <Mode de transfert>, ResData)
Example: Getting a TEST file found in the AAA library of an AS/400:
Réponse, ResData are strings IDFTP = FTPConnect("as400", "login", "MDP") FTPCommand(IDFTP,"RETR " + "AAA/TEST", Réponse, ResData) // ResData contient le fichier fSaveText("C:\Tmp\test", ResData)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|