Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
CURL.PerformAsync
Perform a curl transfer asynchronously.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| CURL | 5.2 | Yes | Yes | Yes | No | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
Result
Returns OK or error.
Description
Perform a curl transfer asynchronously.The query is enqueued and run by the plugin in background.
When transfer is finished, a script is triggered if you set one with CURL.SetFinishedScript function.
This function is called after the init and all the options are set, and will perform the transfer as described in the options. It must be called with the same handle as input as the CURL.New call returned.
You can do any amount of calls to CURL.Perform while using the same handle. If you intend to transfer more than one file, you are even encouraged to do so. CURL will then attempt to re-use the same connection for the following transfers, thus making the operations faster, less CPU intense and using less network resources. Just note that you will have to use the option functions between the invokes to set options for the following CURL.Perform.
While transfer is running, your FileMaker application is not blocked. It's useful to show progress with using CURL.SetUpdateProgressDialog. Be aware that transfer runs in background and you should query status with functions like CURL.IsRunning, CURL.GetProgressTotalDownload, CURL.GetProgressTotalUpload, CURL.GetProgressCurrentDownload and CURL.GetProgressCurrentUpload.
Internal buffer for output, debug and header data is cleared before the perform.
Examples
Start a few transfers:
Go to Record/Request/Page [First]
Loop
Set Variable [$curl; Value:MBS("CURL.New")]
Set Variable [$r; Value:MBS("CURL.SetFinishedScript"; $curl; Get(FileName); "DownloadFinished")]
Set Variable [$r; Value:MBS("CURL.SetProgressScript"; $curl; Get(FileName); "ProgressScript")]
Set Variable [$r; Value:MBS("CURL.SetOptionURL"; $curl; Download Async::URL)]
Set Variable [$r; Value:MBS("CURL.SetTag"; $curl; Get(RecordID))]
Set Field [Download Async::Progress; 0]
Set Field [Download Async::CURL Handle; $curl]
Set Variable [$r; Value:MBS("CURL.PerformAsync"; $curl)]
If [MBS("IsError")]
Show Custom Dialog ["CURL Error"; $r]
End If
Commit Records/Requests [Skip data entry validation; No dialog]
Go to Record/Request/Page [Next; Exit after last]
End Loop
See also
- CURL.SetMultiOptionChunkLengthPenaltySize
- CURL.SetMultiOptionContentLengthPenaltySize
- CURL.SetMultiOptionMaxConcurrentStreams
- CURL.SetMultiOptionMaxHostConnections
- CURL.SetMultiOptionMaxPipelineLength
- CURL.SetMultiOptionMaxTotalConnections
- CURL.SetMultiOptionPipelining
- CURL.SetOptionURL
- CURL.SetProgressScript
- CURL.SetUpdateProgressDialog
Example Databases
Blog Entries
Created 12nd July 2015, last changed 26th December 2018
CURL.Perform - CURL.PerformInBackground
Feedback: Report problem or ask question.
Links
MBS Xojo blog