Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
CURL.Release
End a CURL session.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 2.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
(old name: CURL.Cleanup)
Parameters
Parameter | Description | Example |
---|---|---|
curl | The CURL session handle. | $curl |
Result
Returns "OK" on success or error on failure.
Description
End a CURL session.This function must be the last function to call for a CURL session. It is the opposite of the CURL.New function and must be called with the same handle as input that the CURL.New call returned.
This will effectively close all connections this handle has used and possibly has kept open until now. Don't call this function if you intend to transfer more files.
Any uses of the handle after this function has been called and have returned, are illegal. This kills the handle and all memory associated with it!
Please don't try to close a running transfer.
Used to be named CURL.Cleanup, but we changed named to CURL.Release in version 10.2.
Examples
Cleanup session:
# for every New call
$curl = MBS( "CURL.New")
# work with $curl
# you need a release call on the end
MBS( "CURL.Release"; $curl )
Download URL to temp file:
Set Variable [$curl; Value:MBS("CURL.New")]
#this is URL to download
Set Variable [$url; Value:"https://www.monkeybreadsoftware.com/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; $url)]
#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.GetDebugMessages"; $curl)]
Set Variable [$result; Value:MBS("CURL.Release"; $curl)]
See also
- CURL.ReleaseAll
- CURL.SetupAWS
- CURL.SetupOAuth
- CURL.UseSystemCertificates
- CURL.WebSocketSend
- Folders.System
- GMImage.Scale
- JSON.GetPathItem
- JSON.Parse
- Path.LastPathComponent
Release notes
- Version 10.2
- Added CURL.Release and CURL.ReleaseAll functions. Marked CURL.Cleanup as deprecated.
Example Databases
- CURL/Amazon S3/Amazon S3 Buckets
- CURL/Amazon S3/Amazon S3 Download Picture
- CURL/CURL Download PDF and add preview with DynaPDF
- CURL/CURL Download Picture
- CURL/CURL get and put/CURLS get and put
- CURL/CURL Low Level Sockets
- CURL/Download Async
- CURL/Email/Build and send HTML Email with inline graphics
- CURL/FTP/CURL FTP Upload from file with Progress
- WebHook/WebHook Chat/WebHook Chat
Blog Entries
- Using ChatGPT in FileMaker
- Adding ChatGPT to the ScriptWorkspace context menu
- MQTT in FileMaker
- Background Log Custom function
- MBS Plugin Advent calendar: 21 - SendMail
- Parallel network transfers with MBS Plugin
- Send Audit Log via CURL in background
- How long do you wait for Insert From URL to finish?
- SFTP Upload with temporary file
- CURL Custom Function
FileMaker Magazin
This function is free to use.
Created 18th August 2014, last changed 26th April 2023