TScSFTPServerOpenFileEvent = procedure(Sender: TObject; SFTPSessionInfo: TScSFTPSessionInfo; const FileName: string; const OpenAttributes: TScSFTPFileOpenAttributes; out Data: TObject; var Error: TScSFTPError) of object;


property OnOpenFile: TScSFTPServerOpenFileEvent;



The OnOpenFile event occurs on request from an SFTP client to open or create a file. The returned Data object may be used in other event handlers, for example, in OnReadFile, OnWriteFile, OnCloseFile.

You can call the DefaultOpenFile method to execute this operation or write your own implementation.



Sender - the object whose event handler is called.
SFTPSessionInfo - contains the information about the current SFTP session.
FileName - the name of the file that is being opened. If FileName is the name of a directory, an event handler should return an error. To get an absolute file path, use the GetFullPath method.
OpenAttributes - contains attributes for the file opening.
Data - a parameter to pass the information about an opened file as the TScHandle object or any user's object.
Error - a parameter to pass the information about an error that can arise when opening a file.


See also



SecureBridge Components, Copyright © 2007-2021 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support