CURL.GetResultAsData
--------------------

Returns the result of the transaction as data file.

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

MBS( "CURL.GetResultAsData"; curl; Type { ; FileName } ) 

**MBS**( **"CURL.GetResultAsData";** /\* Returns the result of the transaction as data file. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Type**; /\* The type the new data should have for FileMaker.   
See [container](component_Container.md) functions.   
Typically "PDF " for pdf files, "FILE" for normal binary files and special codes for pictures like "JPEG".e.g. "FILE" \*/   
**$FileName**) /\* Optional; The desired file namee.g. test.zip \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| Type | The type the new data should have for FileMaker.    See [container](component_Container.md) functions.    Typically "PDF " for pdf files, "FILE" for normal binary files and special codes for pictures like "JPEG". | "FILE" |  |
| FileName | The desired file name | test.zip | Optional |

### Result

A container value or empty on error.

### Description

Returns the result of the transaction as data file.  
Make sure the data is in the format you tell FileMaker. FileMaker uses internally 4 letter codes to know what data is stored in containers and you need to pass a suitable type code.  
You may often be better by using [CURL.GetResultAsContainer](CURLGetResultAsContainer.md) function.  
  
Please note that types are always 4 characters long, "PDF " has a space on the end.  
Version 5.2 and later can use the filename from URL if you don't provide one yourself.  
### See also

- [CURL.GetResultAsContainer](CURLGetResultAsContainer.md)
- [CURL.GetResultAsEmail](CURLGetResultAsEmail.md)
- [CURL.GetResultAsGIF](CURLGetResultAsGIF.md)
- [CURL.GetResultAsJPEG](CURLGetResultAsJPEG.md)
- [CURL.GetResultAsMime](CURLGetResultAsMime.md)
- [CURL.GetResultAsPDF](CURLGetResultAsPDF.md)
- [CURL.GetResultAsPNG](CURLGetResultAsPNG.md)
- [CURL.GetResultAsText](CURLGetResultAsText.md)
- [CURL.GetResultLength](CURLGetResultLength.md)

### Example Databases

- [CURL/CURL Download zip file](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20zip%20file.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS Filemaker Plugin, version 2.5pr4](https://www.mbsplugins.de/archive/2012-01-09/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 9th May 2023

  
[CURL.GetResultAsContainer](CURLGetResultAsContainer.md) - [CURL.GetResultAsEMailList](CURLGetResultAsEMailList.md)

[HTML Version](CURLGetResultAsData.shtml)