Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4    Statistic  


Opens file for reading data needed for upload, email sending or HTTP Post.

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

MBS( "CURL.OpenInputFile"; Handle; Path )


Parameter Description Example value
Handle The CURL session handle. $curl
Path Native file path. "C:\Documents\Test.Txt"


Returns "OK" on success or error message.


Opens file for reading data needed for upload, email sending or HTTP Post.
If you set input file, the data from CURL.SetInput* functions is ignored.
Do not call this method while a transfer is running.

If you have data in container, please check CURL.SetInputFile.
You may need to use CURL.SetOptionUpload to make it an upload for FTP/SFTP.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.


Set input from file on disk:

Set Variable [ $result ; Value: MBS( "CURL.OpenInputFile"; $curl; "/Users/cs/Desktop/" ) ]

Upload file via FTP:

Set Variable [$curl; Value:MBS("CURL.New")]

# FTP URL with destination file name:
Set Variable [$result; Value: MBS("CURL.SetOptionURL" ; $curl ; "")]
Set Variable [$result; Value: MBS("CURL.SetOptionUpload" ; $curl ; 1)]
Set Variable [$result; Value: MBS("CURL.SetOptionPassword" ; $curl ; "xxx" )]
Set Variable [$result; Value: MBS("CURL.SetOptionUsername" ; $curl ; "yyy" )]

# Pick file from desktop:
Set Variable [$Desktop; Value: MBS("Folders.UserDesktop")]
Set Variable [$Path; Value: MBS("Path.AddPathComponent"; $desktop; "AZ1677ZZ.jpg")]
Set Variable [$result; Value: MBS( "CURL.OpenInputFile" ; $curl ;$path )]

# Pick file from container:
// Set Variable [$result; Value: MBS( "CURL.SetInputFile" ; $curl ; Test::ImageFileContainer )]

# Upload file
Set Field [Test::PerformResult; MBS( "CURL.Perform" ; $curl )]
Set Field [Test::DebugMessages; MBS( "CURL.GetDebugAsText" ; $curl)]
Set Variable [$result; Value:MBS( "CURL.Cleanup" ; $curl )]

See also

Example Databases

Created 18th August 2014, last changed 1st August 2018

CURL.NumberOfRunningTransfers   -   CURL.Perform

Feedback: Report problem or ask question.

MBS Xojo PDF Plugins