No source for TScSFTError
-
- Posts: 9
- Joined: Mon 12 May 2014 14:05
No source for TScSFTError
I build a SFTP-Server with SecureBridge professinal edition.
In TScSFTPServer is the Event OnOpenDirectory.
This call
procedure TSSHServerFrame.ScSFTPServer1OpenDirectory(Sender: TObject;
SFTPSessionInfo: TScSFTPSessionInfo; const Path: string; var Data: TObject;
var Error: TScSFTPError);
In all the Demo-Software i can not find a pas-File with the Definition of TScSFTError);
The class TScSFTPFileInfo is also not defined.
In TScSFTPServer is the Event OnOpenDirectory.
This call
procedure TSSHServerFrame.ScSFTPServer1OpenDirectory(Sender: TObject;
SFTPSessionInfo: TScSFTPSessionInfo; const Path: string; var Data: TObject;
var Error: TScSFTPError);
In all the Demo-Software i can not find a pas-File with the Definition of TScSFTError);
The class TScSFTPFileInfo is also not defined.
Re: No source for TScSFTError
The TScSFTPError type and the TScSFTPFileInfo class are declared in the ScSFTPUtils.pas unit.
Code: Select all
TScSFTPError = record
ErrorCode: TScSFTPErrorCode;
ErrorMessage: string;
end;
-
- Posts: 9
- Joined: Mon 12 May 2014 14:05
Re: No source for TScSFTError
On the Download it was no file ScSFTPUtils.pas
Only ScSFTPUtils.dcu and ScSFTPUtils.obj
The Compiler Delphi XE 6 doesn't know erOK.
Only ScSFTPUtils.dcu and ScSFTPUtils.obj
The Compiler Delphi XE 6 doesn't know erOK.
Re: No source for TScSFTError
The erOK constant is declared in the ScSFTPConsts unit.
-
- Posts: 9
- Joined: Mon 12 May 2014 14:05
Re: No source for TScSFTError
I found the file with the variable-values.
But where is a description of your SFTP-Server-Implementation?
I need a Log-File for all SFTP-Action.
When i use the OnMakeDirectory-Action, then i get always error.
When i set ErrCode=erOk, then the new Directory not exists. Ftp-Client said okay.
What is wrong?
procedure TSSHServerFrame.ScSFTPServer1MakeDirectory(Sender: TObject;
SFTPSessionInfo: TScSFTPSessionInfo; const Path: string;
var Error: TScSFTPError);
begin
inherited;
//Error.ErrorCode=erOk;
WriteLog('MkDir '+Path,SFTPSessionInfo.Client);
end;
But where is a description of your SFTP-Server-Implementation?
I need a Log-File for all SFTP-Action.
When i use the OnMakeDirectory-Action, then i get always error.
When i set ErrCode=erOk, then the new Directory not exists. Ftp-Client said okay.
What is wrong?
procedure TSSHServerFrame.ScSFTPServer1MakeDirectory(Sender: TObject;
SFTPSessionInfo: TScSFTPSessionInfo; const Path: string;
var Error: TScSFTPError);
begin
inherited;
//Error.ErrorCode=erOk;
WriteLog('MkDir '+Path,SFTPSessionInfo.Client);
end;
-
- Posts: 9
- Joined: Mon 12 May 2014 14:05
Re: No source for TScSFTError
I need a Logfile in SFTP-Server.
If i use the onMakeDirectory-Event, then the component don't create the directory.
If i use the onMakeDirectory-Event, then the component don't create the directory.
Re: No source for TScSFTError
When using the OnMakeDirectory event handler of TScSFTPServer, you should implement the functionality for creating directories by yourslef.
For this, you can call the DefaultMakeDirectory method of the TScSFTPServer component, that creates a directory.
To log directory creation, you can use the following code:
Add the ScSFTPUtils, ScSFTPConsts modules to the uses section to use this code.
For this, you can call the DefaultMakeDirectory method of the TScSFTPServer component, that creates a directory.
To log directory creation, you can use the following code:
Code: Select all
procedure TSSHServerFrame.ScSFTPServer1MakeDirectory(Sender: TObject;
SFTPSessionInfo: TScSFTPSessionInfo; const Path: string;
var Error: TScSFTPError);
begin
TScSFTPServer(Sender).DefaultMakeDirectory(SFTPSessionInfo, Path, Error);
if Error.ErrorCode = erOK then
WriteLog(Path, SFTPSessionInfo.Client)
else
WriteLog(Error.ErrorMessage, SFTPSessionInfo.Client)
end;
-
- Posts: 9
- Joined: Mon 12 May 2014 14:05
Re: No source for TScSFTError
It works very well.
Thanks.
Thanks.
Re: No source for TScSFTError
Feel free to contact us if you have any further questions.