Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
CURL.SetInputJPEG
Sets input to JPEG data from the container value.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 2.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
curl | The CURL session handle. | $curl | |
data | The container value with the data to upload. | ||
Offset | The offset where to start within container. | 0 | Optional |
Length | Size of data to take from the container. Length of container data must be ≥ Length + Offset. |
1024*1024*10 | Optional |
Result
Returns "OK" on success.
Description
Sets input to JPEG data from the container value.Also sets input file length. You need to define input data for file uploads, http posts and http put operations.
Examples
Upload a JPEG file to a FTP Server:
Set Variable [$curl; Value:MBS("CURL.New")]
Set Variable [$result; Value:MBS("CURL.SetOptionURL"; $curl; "ftp://test.test/test/hello.jpg")]
Set Variable [$result; Value:MBS("CURL.SetOptionUpload"; $curl; 1)]
Set Variable [$result; Value:MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password)]
Set Variable [$result; Value:MBS("CURL.SetOptionUserName"; $curl; CURL Test::Name)]
Set Variable [$result; Value:MBS("CURL.SetInputJPEG"; $curl; CURL Test::MyImage)]
Set Field [CURL Test::Result; MBS("CURL.Perform"; $curl)]
Set Field [CURL Test::debug; MBS("CURL.GetDebugMessages"; $curl)]
Set Variable [$result; Value:MBS("CURL.Release"; $curl)]
Send a JPEG via POST request:
Set Variable [$result; Value: MBS("CURL.SetOptionPost"; $curl; 1)]
Set Variable [$result; Value: MBS("CURL.SetInputJPEG”; $curl; MyTable::Image )]
Set Variable [$result; Value: MBS("CURL.SetOptionHTTPHeader"; $curl; "Content-Type: image/jpeg” )]
See also
- CURL.AddInputJPEG
- CURL.New
- CURL.Perform
- CURL.Release
- CURL.SetInputGIF
- CURL.SetInputPNG
- CURL.SetOptionPassword
- CURL.SetOptionPost
- CURL.SetOptionURL
- CURL.SetOptionUserName
Release notes
- Version 12.0
- Added Offset and Length parameters to CURL.SetInputFile, CURL.SetInputGIF, CURL.SetInputJPEG, CURL.SetInputPDF and CURL.SetInputPNG to only upload a portion of the container.
- Version 10.5
- Fixed memory leaks in CURL.SetInputJPEG, CURL.SetInputPNG, CURL.SetInputPDF, CURL.SetInputGIF and CURL.SetInputFile not freeing container. Broken with 10.0.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 11.6pr2
- Translating Insert from URL options for CURL to MBS Plugin calls
- MBS FileMaker Plugin, version 10.5pr7
- CURL Tutorial for Filemaker with MBS Plugin
This function checks for a license.
Created 18th August 2014, last changed 31st January 2023