CURL.GetResultAsJPEG
--------------------

Returns the result of the transaction as JPEG image.

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

MBS( "CURL.GetResultAsJPEG"; curl { ; FileName } ) 

**MBS**( **"CURL.GetResultAsJPEG";** /\* Returns the result of the transaction as JPEG image. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$FileName**) /\* Optional; The desired file name.e.g. test.jpg \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| FileName | The desired file name. | test.jpg | Optional |

### Result

The result value which you can assign to a container field.

### Description

Returns the result of the transaction as JPEG image.  
Make sure the data is a JPEG. The plugin does not verify whether result is a JPEG file. But if it is one, it sets size properties so FileMaker can preview it.  
Version 5.2 and later can use the filename from URL if you don't provide one yourself.  
  
See also [CURL.GetResultAsContainer](CURLGetResultAsContainer.md).  
### Examples

Load JPEG from URL and store in container field:

 # start new transfer   
Set Variable \[$curl ; Value:MBS ("[CURL.New](CURLNew.md)")\]  
\# set URL   
Set Variable \[$r ; Value:MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; "https://monkeybreadsoftware.com/filemaker/images/devcon2013.jpg")\]  
\# run transfer   
Set Variable \[$ErrorCode ; Value:MBS ("[CURL.Perform](CURLPerform.md)"; $curl )\]  
\# get result as JPG and store in field:   
Set Variable \[$Result ; Value:MBS ( "CURL.GetResultAsJPEG"; $curl )\]  
Set Field \[test::MyContainerField ; $Result \]  
\# get debug messages:   
Set Variable \[$DebugMessages ; Value:MBS ( "[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl )\]  
\# cleanup   
Set Variable \[$r ; Value:MBS ("[CURL.Release](CURLRelease.md)"; $curl )\]  
### See also

- [CURL.GetResultAsData](CURLGetResultAsData.md)
- [CURL.GetResultAsEmail](CURLGetResultAsEmail.md)
- [CURL.GetResultAsMime](CURLGetResultAsMime.md)
- [CURL.GetResultAsPDF](CURLGetResultAsPDF.md)
- [CURL.GetResultAsPNG](CURLGetResultAsPNG.md)
- [CURL.GetResultAsText](CURLGetResultAsText.md)
- [CURL.SetDebugWithProgress](CURLSetDebugWithProgress.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)
- [CURL.SetOptionVerbose](CURLSetOptionVerbose.md)
- [CURL.SetupAWS](CURLSetupAWS.md)

### Release notes

- **Version 15.1**
    - Improved [CURL.GetResultAsGIF](https://www.mbsplugins.eu/CURLGetResultAsGIF.shtml), [CURL.GetResultAsJPEG](https://www.mbsplugins.eu/CURLGetResultAsJPEG.shtml), [CURL.GetResultAsPDF](https://www.mbsplugins.eu/CURLGetResultAsPDF.shtml) and [CURL.GetResultAsPNG](https://www.mbsplugins.eu/CURLGetResultAsPNG.shtml) to return empty if the data is not the expected type.

### Example Databases

- [CURL/Amazon S3/Amazon S3 Download Picture](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Amazon%20S3/Amazon%20S3%20Download%20Picture.shtml#1ScriptAnchor_)
- [CURL/CURL Download in Background](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20in%20Background.shtml#1ScriptAnchor_)
- [CURL/CURL Download with Progress](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20with%20Progress.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 15.1pr1](https://www.mbsplugins.de/archive/2025-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Translating Insert from URL options for CURL to MBS Plugin calls](https://www.mbsplugins.de/archive/2020-12-14/Translating_Insert_from_URL_op/monkeybreadsoftware_blog_filemaker)
- [CURL Tutorial for Filemaker with MBS Plugin](https://www.mbsplugins.de/archive/2012-11-18/CURL_Tutorial_for_Filemaker_wi/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 19th April 2020

  
[CURL.GetResultAsGIF](CURLGetResultAsGIF.md) - [CURL.GetResultAsMime](CURLGetResultAsMime.md)

[HTML Version](CURLGetResultAsJPEG.shtml)