Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

CURL.CloseOutputFile

Closes the data output file.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 2.6 Yes Yes Yes Yes Yes

MBS( "CURL.CloseOutputFile"; Handle )

Parameters

Parameter Description Example value
Handle The CURL session handle. $curl

Result

Returns "OK" on success or error message.

Description

Closes the data output file.
To create file for data use CURL.CreateOutputFile function.
The plugin closes files automatically when you call CURL.Cleanup.
Do not call this method while a transfer is running.
In case close operation itself fails, the result is a number with the native file system error code.

Examples

Download URL to temp file:

Set Variable [$curl; Value:MBS("CURL.New")]
#this is URL to download
Set Variable [$url; Value:"http://www.monkeybreadsoftware.de/filemaker/test.txt"]
#get file name from URL
Set Variable [$name; Value:MBS( "Path.LastPathComponent"; $URL )]
#now make temp file path
Set Variable [$path; Value:MBS( "Path.AddPathComponent"; MBS( "Folders.SystemTemporary" ); $name )]
#set URL to download
Set Variable [$r; Value:MBS("CURL.SetOptionURL"; $curl; "http://www.monkeybreadsoftware.de/filemaker/test.txt")]
#open destination file
Set Variable [$r; Value:MBS("CURL.CreateOutputFile"; $curl; $path)]
#run transfer
Set Field [CURL Test::Result; MBS("CURL.Perform"; $curl)]
#close destination file
Set Variable [$r; Value:MBS("CURL.CloseOutputFile"; $curl)]
#get debug messages
Set Field [CURL Test::debug; MBS("CURL.GetDebugAsText"; $curl)]
Set Variable [$result; Value:MBS("CURL.Cleanup"; $curl)]

Close output file:

MBS("CURL.CloseOutputFile"; $curl)

See also


CURL.CloseInputFile   -   CURL.CreateDebugOutputFile

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins