Not working

Written by

in

Automating file transfers using FTPSend depends heavily on whether you are referring to the Windows command-line subsystem (via script files) or the programmatic FTPSend function found within WLanguage (PC SOFT WinDev/WebDev).

Below is the breakdown of how to handle automation safely in both environments.

Method 1: Programmatic Automation via WinDev WLanguage (FTPSend)

If you are developing inside WinDev, FTPSend is a core function used to transfer files. Because it is a blocking function (no other code runs until the transfer completes), automation requires specific structural practices to maintain stability and security.

Establish an Encrypted Connection First: Never use standard FTP. Use FTPConnect with the ftpImplicitSSL or ftpExplicitSSL flags beforehand to wrap your data in TLS/SSL.

Track Progress Safely: Because FTPSend blocks the main thread, utilize its built-in parameter to automatically trigger a status procedure at regular intervals. This prevents your automation bot from hanging indefinitely if a network drop occurs.

Handle Directories Properly: If you pass a directory path to FTPSend, it will replicate the entire folder structure on the remote server. Wildcard symbols (* or ?) are not supported; you must supply explicit file names or complete folders. Code Implementation Structure:

// 1. Secure connection setup ConnectionID is int = FTPConnect(“://server.com”, “user”, “secure_pass”, 21, ftpExplicitSSL) IF ConnectionID <> -1 THEN // 2. Execute blocking send with an updating monitoring callback IF FTPSend(ConnectionID, “C:\LocalFolder\data.xml”, “/RemoteFolder/data.xml”, “TransferCallbackProcedure”) = True THEN // Process success log ELSE // Handle failure alert END FTPDisconnect(ConnectionID) END Use code with caution. Method 2: Command-Line Automation (Windows FTP Scripts)

If you are automating native file transfers via the Windows command prompt, send is a sub-command used inside an interactive text script.

⚠️ CRITICAL SECURITY WARNING: Native Windows Command Prompt FTP (ftp.exe) does not support security protocols like FTPS or SFTP. It transmits passwords and data across the wire in plain text, exposing you to packet-sniffing exploits.

To automate safely on Windows, you must drop the native executable and use a secure alternative like WinSCP or cURL, which support command-line transfers via FTPS/SFTP. How to Automate Securely via WinSCP Scripting: FTPSend (Function) – PC SOFT – Online documentation

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *