Discuss this help topic in SecureBlackbox Forum


TElSFTPServer     See also     

Filter: C#/Java  VB.NET  Pascal  C++  PHP  

This event is fired when your software has to read the data from the file.


    event TElSFTPServerReadEvent OnReadFile;
    delegate void TElSFTPServerReadEvent(Object Sender, Object Data, long Offset, ref byte[] Buffer, int BufferOffset, int Count, ref int Read, ref int ErrorCode, ref string Comment);

    Event OnReadFile As TElSFTPServerReadEvent
    Delegate Sub TElSFTPServerReadEvent(ByVal Sender As Object, ByVal Data As Object, ByVal Offset As Long, ByRef Buffer As Byte(), ByVal BufferOffset As Integer, ByVal Count As Integer, ByRef Read As Integer, ByRef ErrorCode As Integer, ByRef Comment As String)

    property OnReadFile: TSBSFTPServerReadEvent;
    TSBSFTPServerReadEvent = procedure(Sender : TObject; const Data: pointer; Offset : Int64; Buffer : Pointer; Count : integer; var Read : integer; var ErrorCode : integer; var Comment : string) of object;

    void get_OnReadFile(TElSFTPServerReadEvent &pMethodOutResult, void * &pDataOutResult);
    void set_OnReadFile(TElSFTPServerReadEvent pMethodValue, void * pDataValue);
    typedef void (SB_CALLBACK *TElSFTPServerReadEvent)(void * _ObjectData, TObjectHandle Sender, void * Data, int64_t Offset, void * Buffer, int32_t Count, int32_t &Read, int32_t &ErrorCode, char * pcComment, int32_t &szComment);

    TElSFTPServerReadEvent|callable|NULL get_OnReadFile()
    void set_OnReadFile(TElSFTPServerReadEvent|callable|NULL $Value)
    callable TElSFTPServerReadEvent(TObject $Sender, TSBPointer|NULL $Data, integer $Offset, TSBPointer|NULL $Buffer, integer $Count, integer &$Read, integer &$ErrorCode, string &$Comment)


  • Data - user data associated with the opened file
  • Offset - position from which the file is read
  • Buffer - buffer that contains read data
  • BufferOffset - start position in the buffer from which the data must be read
  • Count - amount of bytes to be read
  • Read - amount of bytes have been actually read
  • ErrorCode - the error code, see values below
  • Comment - server comment
  • pcComment - server comment
  • szComment - the length of pcComment.

Error codes values:


    This event is fired when the file contents must be read and sent to the client.
The application can return the error code in ErrorCode parameter and textual comment in Comment parameter.

See also:     OnOpenFile     OnRenameFile     OnRemove     OnWriteFile     OnReadSymLink    

Discuss this help topic in SecureBlackbox Forum