Platforms to show: All Mac Windows Linux Cross-Platform

Back to CURLNMBS class.

CURLNMBS.ChunkBegin(FileInfo as CURLNFileInfoMBS, Remains as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 15.2 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event called on begin of a new chunk.

If splitting of data transfer is enabled, this event is called before download of an individual chunk started. Note that parameter "remains" works only for FTP wildcard downloading (for now), otherwise is not used.

CURLNMBS.ChunkEnd(FileInfo as CURLNFileInfoMBS, Remains as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 15.2 ✅ Yes ✅ Yes ✅ Yes ❌ No
Download of a chunk ended.

If splitting of data transfer is enabled this event is called after download of an individual chunk finished.
This event is called for skipped or downloaded files.

CURLNMBS.DebugMessage(infotype as Integer, data as string, dataSize as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 9.8 ✅ Yes ✅ Yes ✅ Yes ❌ No
A debug event to get data of ongoing process.

You may need to set OptionVerbose to true.

infotype constants:
kInfo_TEXT0The data is informational text.
kInfo_HEADER_IN1The data is header (or header-like) data received from the peer.
kInfo_HEADER_OUT2The data is header (or header-like) data sent to the peer.
kInfo_DATA_IN3The data is protocol data received from the peer.
kInfo_DATA_OUT4The data is protocol data sent to the peer.
kInfo_SSL_DATA_IN5The data is protocol data received from the peer.
kInfo_SSL_DATA_OUT6The data is protocol data sent to the peer.

If you set CollectDebugMessages, the plugin will collect the messages and provide them via the DebugMessages property. You can still use this event to write your own log instead of in addition.

CURLNMBS.FileNameMatch(Pattern as String, Name as String) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 15.2 ✅ Yes ✅ Yes ✅ Yes ❌ No
Match a file against a pattern.

If you don't implement this event, you get the default implementation from CURL.
Return kFileNameMatchNoMatch, kFileNameMatchIsMatch or kFileNameMatchFailed.

CURLNMBS.Finished(Result as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 15.2 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event called when transfer has finished.

For Perform and PerformMT it is called before Perform function returns, so in PerformMT this is called on the thread.
For use with CURLNMultiMBS, it is called after TransferFinished event and before TransfersFinished event.
If you want to modify GUI and use PeformMT, you may need to start a timer to do so.

CURLNMBS.Header(data as string, dataSize as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 9.8 ✅ Yes ✅ Yes ✅ Yes ❌ No
New Header data was received.

You can get error 23 if you don't return lenb(data) in this event.
Or just leave it emtpy so RB will not include it in your application the plugin will return lenb(data) itself.

If you set CollectHeaderData to true, the plugin will collect the messages and provide them via the HeaderData property. You can still use this event to write your own log instead of in addition.

CURLNMBS.Progress(dltotal as Int64, dlnow as Int64, ultotal as Int64, ulnow as Int64, percent as Double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 9.8 ✅ Yes ✅ Yes ✅ Yes ❌ No
An event to report progress of ongoing transfers.

This function gets called by libCURL with a frequent interval during operation (roughly once per second) no matter if data is being transfered or not. Unknown/unused argument values passed to the event will be set to zero (like if you only download data, the upload size will remain 0).
Returning a true from this event will cause libCURL to abort the transfer and return kError_ABORTED_BY_CALLBACK.

You can run CURL from a thread to download several things at the same time or keep the GUI more responsive. For better GUI, you can even call a method like app.DoEvents to get the GUI updated more often.

When sending email, ultotal may be zero. In that case use OptionInFileSize to know size of email to upload.

CURLNMBS.Read(count as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 9.8 ✅ Yes ✅ Yes ✅ Yes ❌ No
This event gets called by libCURL as soon as it needs to read data in order to send it to the peer.

Return the number of bytes requested. Never return a string with lenb(string)>count. You can return 0 to inform about end of file.

If you stop the current transfer by returning 0 "pre-maturely" (i.e before the server expected it, like when you've told you will upload N bytes and you upload less than N bytes), you may experience that the server "hangs" waiting for the rest of the data that won't come.

The read event may return CURL_READFUNC_ABORT (&h10000000) to stop the current operation immediately, resulting in a kError_ABORTED_BY_CALLBACK error code from the transfer (Added in 7.12.1)

This event is not called when using PerformMT.

If you provide Input data via SetInputData or OpenMTInputFile method, this event is not called and data is taken from the data you provided.

CURLNMBS.RestartRead() as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 9.8 ✅ Yes ✅ Yes ✅ Yes ❌ No
An event to inform you that reading on the file needs to start at the beginning again.

Return true on success.
If you use a binarystream for reading you will have to set position to 0 in this event.

This event is not called when using PerformMT.

CURLNMBS.Seek(pos as Int64, whence as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 12.2 ✅ Yes ✅ Yes ✅ Yes ❌ No
Called when CURL needs to perform a seek.

Normally only needed if you resume a download (Seek forward) or upload is reset (seek back).
Whence is kSeekOriginCurrent, kSeekOriginEnd or kSeekOriginSet.
Please return one of this constants: kSeekReturnCantSeek, kSeekReturnFail or kSeekReturnOk.

CURLNMBS.SSHKey(KnownKey as string, KnownKeyLength as Integer, KnownKeyType as Integer, FoundKey as string, FoundKeyLength as Integer, FoundKeyType as Integer, MatchStatus as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 10.0 ✅ Yes ✅ Yes ✅ Yes ❌ No
The event for known hosts event for SFTP and SCP.

KnownKey: The known key as string encoded with base64 if KnownKeyLength is zero, otherwise the "raw" data.
KnownKeyLength: The length of the key. Zero for base64 encoded key.
KnownKeyType: The type of the key. (0 = Unknown, 1 = RSA1, 2 = RSA, 3 = DSS)
FoundKey: The found key as string encoded with base64 if FoundKeyLength is zero, otherwise the "raw" data.
FoundKeyLength: The length of the key. Zero for base64 encoded key.
FoundKeyType: The type of the key. (0 = Unknown, 1 = RSA1, 2 = RSA, 3 = DSS)
MatchStatus: The status CURL found. (0 = OK, 1 = Mismatch, 2 = Missing)

Return one of the following values:
CURLKHSTAT_FINE_ADD_TO_FILE0Fine and add to file
CURLKHSTAT_FINE1Fine
CURLKHSTAT_REJECT2reject the connection, return an error
CURLKHSTAT_DEFER3do not accept it, but we can't answer right now so this causes a CURLE_DEFER error but otherwise the connection will be left intact etc

CURLNMBS.Write(data as string, dataSize as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event CURL MBS CURL Plugin 9.8 ✅ Yes ✅ Yes ✅ Yes ❌ No
This event gets called by libCURL as soon as there is data received that needs to be saved.

Return the number of bytes actually taken care of. If that amount differs from the amount passed to your function, it'll signal an error to the library and it will abort the transfer and return kError_WRITE_ERROR.

This function may be called with zero bytes data if the transfered file is empty.

The event function will be passed as much data as possible in all invokes, but you cannot possibly make any assumptions. It may be one byte, it may be thousands. The maximum amount of data that can be passed to the write event is defined in the CURL.h header file: CURL_MAX_WRITE_SIZE (16384).

If you set CollectOutputData to true, the plugin will automatically collect the data and provide it to you after the transfer with the OutputData property. This collecting feature will only work right, if there is enough free memory. You can of course still process data yourself in this event instead of in addition.

The items on this page are in the following plugins: MBS CURL Plugin.


The biggest plugin in space...