Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

CURL.SetOptionWildCardMatch

Enable wildcard matching.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 5.2 Yes Yes Yes Yes Yes

MBS( "CURL.SetOptionWildCardMatch"; Handle; Value )

Parameters

Parameter Description Example value
Handle The CURL session handle. $curl
Value The new setting. Can be 1 (on) or 0 (off). 1

Result

Returns OK or error.

Description

Enable wildcard matching.
Set parameter to 1 if you want to transfer multiple files according to a file name pattern. The pattern can be specified as part of the OptionURL option, using an fnmatch-like pattern (Shell Pattern Matching) in the last part of URL (file name).

By default, libcurl uses its internal wildcard matching implementation.

A brief introduction of its syntax follows:


ftp://example.com/some/path/*.txt (for all txt's from the root directory)

? - QUESTION MARK

Question mark matches any (exactly one) character.

ftp://example.com/some/path/photo?.jpeg

[ - BRACKET EXPRESSION

The left bracket opens a bracket expression. The question mark and asterisk have no special meaning in a bracket expression. Each bracket expression ends by the right bracket and matches exactly one character. Some examples follow:

[a-zA-Z0-9] or [f-gF-G] - character interval
[abc] - character enumeration
[^abc] or [!abc] - negation
[[:name:]] class expression. Supported classes are alnum,lower, space, alpha, digit, print, upper, blank, graph, xdigit.
[][-!^] - special case - matches only '-', ']', '[', '!' or '^'. These characters have no special purpose.
[\[\]\\] - escape syntax. Matches '[', ']' or '´.

Using the rules above, a file name pattern can be constructed:

ftp://example.com/some/path/[a-z[:upper:]\\].jpeg

This feature is only supported for FTP download.

Examples

Enable wildcard match:

MBS( "CURL.SetOptionWildCardMatch"; $curl; 1 )

Download several files via FTP:

Set Variable [$curl; Value:MBS("CURL.New")]
#Set URL with wildcard match
Set Variable [$result; Value:MBS("CURL.SetOptionURL"; $curl; CURL Test::URL)]
#Set folder where to put files
Set Variable [$result; Value:MBS("CURL.SetBatchDestinationPath"; $curl; CURL Test::DestPath)]
#credentials...
Set Variable [$result; Value:MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password)]
Set Variable [$result; Value:MBS("CURL.SetOptionUsername"; $curl; CURL Test::Name)]
#enable wildcard match
Set Variable [$result; Value:MBS("CURL.SetOptionWildCardMatch"; $curl; 1)]
#download them all
Set Field [CURL Test::Result; MBS("CURL.Perform"; $curl)]
#check results
Set Field [CURL Test::debug; MBS("CURL.GetDebugAsText"; $curl)]
Set Field [CURL Test::FileNames; MBS("CURL.GetBatchFileNames"; $curl)]
Set Variable [$result; Value:MBS("CURL.Cleanup"; $curl)]

See also

Example Databases


CURL.SetOptionVerbose   -   CURL.SetProgressEvaluate

Feedback: Report problem or ask question.




Links
MBS FileMaker tutorial videos