CURL.Release
------------

End a CURL session.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [2.5](newinversion25.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.Release"; curl ) 

**MBS**( **"CURL.Release";** /\* End a CURL session. \*/  
**$curl**) /\* The CURL session handle. \*/ 

(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](CURLNew.md) function and must be called with the same handle as input that the [CURL.New](CURLNew.md) 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   
Set Variable \[ $curl ; Value: MBS ( "[CURL.New](CURLNew.md)") \]  
  
\# work with $curl   
  
\# you need a release call on the end   
Set Variable \[ $r ; Value: MBS ( "CURL.Release"; $curl ) \]  
Download URL to temp file:

 Set Variable \[$curl ; Value:MBS ("[CURL.New](CURLNew.md)")\]  
\#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](PathLastPathComponent.md)"; $URL )\]  
\#now make temp file path   
Set Variable \[$path ; Value:MBS ( "[Path.AddPathComponent](PathAddPathComponent.md)"; MBS ( "[Folders.SystemTemporary](FoldersSystemTemporary.md)" ); $name )\]  
\#set URL to download   
Set Variable \[$r ; Value:MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; $url )\]  
\#open destination file   
Set Variable \[$r ; Value:MBS ("[CURL.CreateOutputFile](CURLCreateOutputFile.md)"; $curl ; $path )\]  
\#run transfer   
Set Field \[CURL Test::Result ; MBS ("[CURL.Perform](CURLPerform.md)"; $curl )\]  
\#close destination file   
Set Variable \[$r ; Value:MBS ("[CURL.CloseOutputFile](CURLCloseOutputFile.md)"; $curl )\]  
\#get debug messages   
Set Field \[CURL Test::debug ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl )\]  
Set Variable \[$result ; Value:MBS ("CURL.Release"; $curl )\]  
### See also

- [CURL.ReleaseAll](CURLReleaseAll.md)
- [CURL.SetupAWS](CURLSetupAWS.md)
- [CURL.SetupOAuth](CURLSetupOAuth.md)
- [CURL.UseSystemCertificates](CURLUseSystemCertificates.md)
- [CURL.WebSocketSend](CURLWebSocketSend.md)
- [Folders.System](FoldersSystem.md)
- [GMImage.Scale](GMImageScale.md)
- [JSON.GetPathItem](JSONGetPathItem.md)
- [JSON.Parse](JSONParse.md)
- [Path.LastPathComponent](PathLastPathComponent.md)

### Release notes

- **Version 10.2**
    - Added [CURL.Release](https://www.mbsplugins.eu/CURLRelease.shtml) and [CURL.ReleaseAll](https://www.mbsplugins.eu/CURLReleaseAll.shtml) functions. Marked [CURL.Cleanup](https://www.mbsplugins.eu/CURLRelease.shtml) as deprecated.

### Example Databases

- [CURL/Amazon S3/Amazon S3 Upload Picture](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Amazon%20S3/Amazon%20S3%20Upload%20Picture.shtml#3ScriptAnchor_)
- [CURL/CURL Download on Server](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20on%20Server.shtml#1ScriptAnchor_)
- [CURL/CURL Download Picture](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20Picture.shtml#1ScriptAnchor_)
- [CURL/CURL Download with Progress](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20with%20Progress.shtml#1ScriptAnchor_)
- [CURL/CURL Download zip file](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20zip%20file.shtml#1ScriptAnchor_)
- [CURL/Email/Email Client](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Email%20Client.shtml#3ScriptAnchor_)
- [CURL/Email/GMail oAuth SMTP](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/GMail%20oAuth%20SMTP.shtml#3ScriptAnchor_)
- [CURL/Email/IMAP Email Upload](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/IMAP%20Email%20Upload.shtml#1ScriptAnchor_)
- [CURL/FTP/CURL FTP Upload](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Upload.shtml#1ScriptAnchor_)
- [Third Party/Google OAUTH 2 example](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Third%20Party/Google%20OAUTH%202%20example.shtml#1ScriptAnchor_)

### Blog Entries

- [IMAP Upload Flags](https://www.mbsplugins.de/archive/2025-06-17/IMAP_Upload_Flags/monkeybreadsoftware_blog_filemaker)
- [Using Gmail with oAuth2 for SMTP with MBS Plugin](https://www.mbsplugins.de/archive/2025-05-08/Using_Gmail_with_oAuth2_for_SM/monkeybreadsoftware_blog_filemaker)
- [Send SMS with Amazon web service](https://www.mbsplugins.de/archive/2025-01-20/Send_SMS_with_Amazon_web_servi/monkeybreadsoftware_blog_filemaker)
- [Using ChatGPT in FileMaker](https://www.mbsplugins.de/archive/2024-10-16/Using_ChatGPT_in_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Adding ChatGPT to the ScriptWorkspace context menu](https://www.mbsplugins.de/archive/2024-09-18/Adding_ChatGPT_to_the_ScriptWo/monkeybreadsoftware_blog_filemaker)
- [MQTT in FileMaker](https://www.mbsplugins.de/archive/2024-06-25/MQTT_in_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Background Log Custom function](https://www.mbsplugins.de/archive/2024-01-09/Background_Log_Custom_function/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 21 - SendMail](https://www.mbsplugins.de/archive/2023-12-21/MBS_Plugin_Advent_calendar_21_/monkeybreadsoftware_blog_filemaker)
- [Parallel network transfers with MBS Plugin](https://www.mbsplugins.de/archive/2023-12-18/Parallel_network_transfers_wit/monkeybreadsoftware_blog_filemaker)
- [Send Audit Log via CURL in background](https://www.mbsplugins.de/archive/2023-11-30/Send_Audit_Log_via_CURL_in_bac/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2024, Seite 39](https://filemaker-magazin.de/neuigkeit/4277-Appetithappen-FMM_202406)
- [Ausgabe 2/2024, Seite 18](https://filemaker-magazin.de/neuigkeit/4257-Appetithappen-FMM_202402)
- [Ausgabe 6/2021, Seite 23](https://filemaker-magazin.de/neuigkeit/4165-Appetithappen-FMM_202106)
- [Ausgabe 4/2016, Seite 18 bis 20](https://filemaker-magazin.de/neuigkeit/3876-Appetithappen-FMM_201604)
- [Ausgabe 5/2014, Seite 26](https://filemaker-magazin.de/neuigkeit/3759-Appetithappen-FMM_201405)

This function is free to use.

Created 18th August 2014 , last changed 25th February 2026

  
[CURL.ReceiveText](CURLReceiveText.md) - [CURL.ReleaseAll](CURLReleaseAll.md)

[HTML Version](CURLRelease.shtml)