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

Saves the contents to a given file.

Syntax

MIGetContentToFile( ByVal hFile As CHttpFile,
	ByVal strFileName As String As SmallInt

hFile is a CHttpFile handle

strFileName is a string that identifies the local file name that receives the content of hFile.

Return Value

Nonzero if successful; otherwise 0. To determine the cause of the failure, call the MIGetErrorMessage() function.

Description

This function is used to save the content to a CHttpFile to a local file, which is an alternative to MIGetContent. It will create a new file with given file name. If the file exists already, it is truncated to 0 length. It has to remember that MIGetContentToFile and MIGetContent are exclusive, which means you can only use one of them during the life time of a CHttpFile object.