MIGetFtpConnection() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Establishes an FTP connection and gets a handle to a CFtpConnection object.

Syntax

MIGetFtpConnection( ByVal hSession As CInternetSession, 
	ByVal strServer As String, ByVal strUserName As String, 
	ByVal strPassword As String, ByVal nPort As INTERNET_PORT )
	As CFtpConnection

hSession is a CinternetSession handle.

strServer is a string that contains the FTP server name.

strUserName is a string that specifies the name of the user to log in.

strPassword is a string that specifies the password to use to log in.

nPort is a number that identifies the TCP/IP port to use on the server.

Return Value

A handle to a CFtpConnection object. If the call fails, Null is returned. To determine the cause of the failure, call the MIGetErrorMessage() function.

Description

MIGetFtpConnection() connects to an FTP server, creates and returns a handle to a CFtpConnection object. It does not perform any specific operation on the server. If you intend to get or put files, for example, you must perform those operations as separate steps.

The caller has to dispose of the handle by calling the MICloseFtpConnection() procedure when the handle is no longer in use.