2025-07-17 22:02:56 +03:00
---
2025-09-10 14:54:07 +03:00
sidebar_position: 12
2025-07-17 22:02:56 +03:00
description: Get connection settings and other functions to work with FTP in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, FTP]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Get connection settings
Creates a structure of FTP connection settings
2025-07-30 08:17:11 +03:00
`Function GetConnectionSettings(Val Host, Val Port = 21, Val Login = Undefined, Val Password = Undefined, Val Passive = True, Val ReadTimeout = 120, Val WriteTimeout = 120, Val IPResolve = True) Export`
2025-07-17 22:02:56 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
2025-07-30 08:17:11 +03:00
| Host | --host | String | ✔ | Host addres |
2025-07-17 22:02:56 +03:00
| Port | --port | Number | ✖ | Server port |
| Login | --login | String, Undefined | ✖ | Username for authorization, if required |
| Password | --pass | String, Undefined | ✖ | User password for authorization, if required |
| Passive | --passive | Boolean | ✖ | Passive connection mode |
| ReadTimeout | --rtout | Number | ✖ | Read timeout |
| WriteTimeout | --wtout | Number | ✖ | Write timeout |
2025-07-29 19:27:56 +03:00
| IPResolve | --ipresl | Boolean | ✖ | Advanced passive mode address resolution |
2025-07-17 22:02:56 +03:00
Returns: Structure Of KeyAndValue - Connection settings structure
<br/>
2025-07-29 19:27:56 +03:00
:::tip
2025-07-30 08:17:11 +03:00
When `IPResolve = True`, the connection address returned by the server in passive mode after `PASV` will be replaced with the IP from the `Host` field, in cases when a proxy is used or the server returns `127.0.0.1` (only if an IP address is specified in the `Host` field))
2025-07-29 19:27:56 +03:00
:::
<br/>
2025-07-17 22:02:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-07-30 08:17:11 +03:00
Host = "172.33.0.10";
2025-07-28 20:20:57 +03:00
Port = "21";
2025-07-18 19:54:06 +03:00
Login = "bayselonarrend";
Password = "12we...";
2025-07-17 22:02:56 +03:00
2025-07-30 08:17:11 +03:00
Result = OPI_FTP.GetConnectionSettings(Host, Port, Login, Password);
2025-07-17 22:02:56 +03:00
```
2025-09-16 09:07:33 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint ftp GetConnectionSettings \
--host "172.33.0.11" \
--port 21 \
--login "bayselonarrend" \
--pass "***"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint ftp GetConnectionSettings ^
--host "172.33.0.11" ^
--port 21 ^
--login "bayselonarrend" ^
--pass "***"
```
</TabItem>
</Tabs>
2025-07-17 22:02:56 +03:00
2025-09-12 20:23:31 +03:00
```json title="Result"
{
"domain": "172.33.0.11",
"port": 21,
"passive": true,
"read_timeout": 120,
"write_timeout": 120,
"advanced_resolve": true,
"login": "bayselonarrend",
"password": "***"
}
```