From c9c9d57ea9d814b32dbe5ec8b41f1534e547b084 Mon Sep 17 00:00:00 2001 From: Anton Titovets Date: Wed, 10 Sep 2025 14:46:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BE=D0=BA=D0=BE=D0=B2=20FTP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/md/Instructions/FTP.md | 81 ++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 docs/en/md/Instructions/FTP.md diff --git a/docs/en/md/Instructions/FTP.md b/docs/en/md/Instructions/FTP.md new file mode 100644 index 0000000000..8df835cb7c --- /dev/null +++ b/docs/en/md/Instructions/FTP.md @@ -0,0 +1,81 @@ +--- +id: FTP +sidebar_class_name: FTP +keywords: [1C, 1C:Enterprise, 1C:Enterprise 8.3, API, Integration, Services, Data Exchange, OneScript, CLI, FTP, FTPS] +--- + + + +# FTP(s) + +This section is dedicated to the library for working with FTP(s). On this page, all the steps necessary to start working are described + +## Getting Started + +This library provides various methods for working with FTP(s) on the client side. Each method accepts a `Connection` as its first parameter, which can be initialized in one of two ways: + +1. Using the `OpenConnection` function. In this case, a component object is returned that supports a single connection for multiple requests. +2. Using the `GetConnectionConfiguration` function. In this case, only a connection description structure is returned. Each function receiving this structure as the `Connection` parameter will internally create a new connection and close it upon completion + +When performing multiple sequential requests to an FTP server, it is recommended to use a full connection obtained via the `OpenConnection` function + +## Proxy Usage + +The client supports establishing connections through a proxy server. Proxy settings can be obtained using the `GetProxySettings` function. The resulting structure must then be passed to either `OpenConnection` or `GetConnectionConfiguration` when initiating work + +```bsl + + ... + + ProxyType = "http"; // http, socks5, socks4 + + ProxyAddress = FunctionParameters["Proxy_IP"]; + ProxyPort = FunctionParameters["Proxy_Port"]; + ProxyLogin = FunctionParameters["Proxy_User"]; + ProxyPassword = FunctionParameters["Proxy_Password"]; + + ProxySettings = OPI_FTP.GetProxySettings(ProxyAddress, ProxyPort, ProxyType, ProxyLogin, ProxyPassword); + + Connection = OPI_FTP.CreateConnection(FTPSettings, ProxySettings, TLSSettings); + +``` + +Support is provided for socks4, socks5, and http proxy servers + +:::warning +Operation via http-proxy is experimental and may be unstable depending on the proxy server’s implementation, configuration, and capabilities. It is recommended to use socks-proxy whenever possible for stable traffic transmission +::: + +## FTPS (TLS) + +The client also supports secure connections via TLS. To enable it, pass the TLS settings structure to `OpenConnection` or `GetConnectionConfiguration` when initiating work. The TLS settings structure can be obtained using the `GetTlsSettings` function + + +```bsl + + ... + + TLSSettings = OPI_FTP.GetTLSSettings(True); + Connection = OPI_FTP.CreateConnection(FTPSettings, ProxySettings, TLSSettings); + +``` + + + If UseProxy Then + + ProxyType = FunctionParameters["Proxy_Type"]; // http, socks5, socks4 + + ProxyAddress = FunctionParameters["Proxy_IP"]; + ProxyPort = FunctionParameters["Proxy_Port"]; + ProxyLogin = FunctionParameters["Proxy_User"]; + ProxyPassword = FunctionParameters["Proxy_Password"]; + + ProxySettings = OPI_FTP.GetProxySettings(ProxyAddress, ProxyPort, ProxyType, ProxyLogin, ProxyPassword); + + EndIf; + + If FTPS Then + TLSSettings = OPI_FTP.GetTLSSettings(True); + EndIf; + + Connection = OPI_FTP.CreateConnection(FTPSettings, ProxySettings, TLSSettings); \ No newline at end of file