Xceed FTP Library Documentation
SendMemoryFileData method
XceedFtp control reference > Methods > SendMemoryFileData method

Description

Allows you to provide the memory data for a file being sent directly from memory into a file on the FTP server.

Before you call this method, you must initiate the transfer by calling the SendMemoryFile method.

You can provide the entire data to send with a single call to the SendMemoryFileData method by providing the data in the vaData parameter and by specifying True in the bEndOfData parameter. You can also provide the data in smaller chunks (streaming fashion), by making multiple calls to the SendMemoryFileData method, each time providing a chunk of data in the vaData parameter and specifying False in the bEndOfData parameter. When the final chunk or data is provided, specify True in the bEndOfData parameter.

The vaData parameter can contain many kinds of data types, but the RepresentationType property can affect how this data is interpreted. When using the frtBinary representation type, the variant’s data is sent unmodified. When using the frtASCII representation type, the data is considered to be an ANSI string, except if it is a BSTR. If it is a BSTR, the data is considered to be a UNICODE string, and it is converted to an ANSI string before making the conversion to NVT-ASCII chars.

This method does not trigger the ProcessCompleted event when called with the BackgroundProcessing property set to True. Only the completion of a call to the SendMemoryFile method will trigger the ProcessCompleted event. But if a call to the SendMemoryFileData method fails, the pending SendMemoryFile call will also fail, thus triggering the ProcessCompleted event.

This method can only be used when the CurrentState property's value is fcsSendingMemoryFile.

Parameters
 

Parameter Description
vaData  The data to send. This can be any standard VARIANT or SAFEARRAY type. For example, it can be an array of bytes, an array of longs, a string (BSTR), single values like integers, longs, floats, doubles, etc. Cannot be a user-defined type.
bEndOfData  Set to True if there is no more data to send for the file, set to False if more data will be provided for the file via a subsequent call to the SendMemoryFileData method.

 

Declaration  
HRESULT SendMemoryFileData( [in] VARIANT* vaData, [in] VARIANT_BOOL bEndOfData )

Applicable properties

AccountName, RepresentationType

Events triggered

FileMatched, FileTransferStatus, LoggingCommandLine, ProcessCompleted, ScanningFolder, SendingFile