Skip to main content

Get connection settings

Creates a structure of FTP connection settings

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

ParameterCLI optionTypeRequiredDescription
Host--hostStringHost addres
Port--portNumberServer port
Login--loginString, UndefinedUsername for authorization, if required
Password--passString, UndefinedUser password for authorization, if required
Passive--passiveBooleanPassive connection mode
ReadTimeout--rtoutNumberRead timeout
WriteTimeout--wtoutNumberWrite timeout
IPResolve--ipreslBooleanAdvanced passive mode address resolution

Returns: Structure Of KeyAndValue - Connection settings structure


tip

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))


1C:Enterprise/OneScript code example
    Host     = "172.33.0.10";
Port = "21";
Login = "bayselonarrend";
Password = "12we...";

Result = OPI_FTP.GetConnectionSettings(Host, Port, Login, Password);
    oint ftp GetConnectionSettings \
--host "172.33.0.11" \
--port 21 \
--login "bayselonarrend" \
--pass "***"
Result
{
"domain": "172.33.0.11",
"port": 21,
"passive": true,
"read_timeout": 120,
"write_timeout": 120,
"advanced_resolve": true,
"login": "bayselonarrend",
"password": "***"
}