CURL.CreateDebugOutputFile
--------------------------

Creates output file for writing debug messages.

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

MBS( "CURL.CreateDebugOutputFile"; curl; Path ) 

**MBS**( **"CURL.CreateDebugOutputFile";** /\* Creates output file for writing debug messages. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Path**) /\* Native file path.e.g. C:\\Documents\\Test.Txt \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Path | Native file path. | C:\\Documents\\Test.Txt |

### Result

Returns "OK" on success or error message.

### Description

Creates output file for writing debug messages.  
Debug messages are written to file if you use this functions and debug messages are always collected for calling [CURL.GetDebugMessages](CURLGetDebugMessages.md) after the transfer. This can be useful as you can have your FileMaker solution write a copy of debug messages in temporary file. If your client has problems, you can simply read messages from last transfer. If creation of the file fails, you get an error message back, but still your transfer will probably succeed.  
Do not call this method while a transfer is running.  
  
Logging to a file is useful to read messages in case FileMaker crashes while a transfer.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Write copy of debug messages to a file into temp folder on Mac:

 MBS ( "CURL.CreateDebugOutputFile"; $curl ; "/tmp/LastMessages.txt" )  
### See also

- [CURL.CloseDebugFile](CURLCloseDebugFile.md)
- [CURL.CreateHeaderOutputFile](CURLCreateHeaderOutputFile.md)
- [CURL.CreateOutputFile](CURLCreateOutputFile.md)
- [CURL.GetDebugMessages](CURLGetDebugMessages.md)
- [CURL.SetDebugWithProgress](CURLSetDebugWithProgress.md)
- [CURL.SetOptionVerbose](CURLSetOptionVerbose.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Release notes

- **Version 11.1**
    - Added extra line to CURL debug log to indicate the version of [MBS FileMaker Plugin](https://www.monkeybreadsoftware.com/filemaker/), CURL library used and what OS is used and FileMaker application. See [CURL.CreateDebugOutputFile](https://www.mbsplugins.eu/CURLCreateDebugOutputFile.shtml) and [CURL.GetDebugAsText](https://www.mbsplugins.eu/CURLGetDebugAsText.shtml) functions.

### Example Databases

- [CURL/FTP/CURL FTP Download File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Download%20File.shtml#2ScriptAnchor_)
- [CURL/FTP/CURL FTP Upload File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Upload%20File.shtml#2ScriptAnchor_)
- [CURL/SFTP/CURL sFTP Upload File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/SFTP/CURL%20sFTP%20Upload%20File.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 11.1pr1](https://www.mbsplugins.de/archive/2021-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Debugging problems on FileMaker Cloud for AWS](https://www.mbsplugins.de/archive/2019-06-30/Debugging_problems_on_FileMake/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.6pr4](https://www.mbsplugins.de/archive/2012-02-17/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 3th January 2023

  
[CURL.CloseOutputFile](CURLCloseOutputFile.md) - [CURL.CreateHeaderOutputFile](CURLCreateHeaderOutputFile.md)

[HTML Version](CURLCreateDebugOutputFile.shtml)