SFTP server error occured: Invalid file ID
Posted: Thu 10 Jul 2014 13:32
Dear Sir,
I am trying to use SecureBridge in order to upload a file w/ SFTP
Each attempt returns: 'SFTP server error occured: Invalid file ID'
And I cannot find any help on the error code anywhere.
Of course, strFilename conatains a valid file path.
I have no problem doing the upload using i.e. filezilla and the same credentials I use programmatically.
Do you know what could be wrong?
Code is very simple:
ScSSHClient1.HostName := strHostName;
ScSSHClient1.User := strUsername;
ScSSHClient1.Password := strPassword;
ScSSHClient1.KeyStorage := ScFileStorage1;
ScSSHClient1.Connect;
ScSFTPClient1.Initialize;
ScSFTPClient1.UploadFile(strFilename, ExtractFileName(strFilename), False);
procedure TfrmMain.ScSSHClient1ServerKeyValidate(Sender: TObject; NewServerKey: TScKey; var Accept: Boolean);
var
Key: TScKey;
fp, msg: string;
begin
Key := ScSSHClient1.KeyStorage.Keys.FindKey(ScSSHClient1.HostName);
if (Key = nil) or not Key.Ready then begin
NewServerKey.GetFingerPrint(haMD5, fp);
Key := TScKey.Create(nil);
Key.Assign(NewServerKey);
Key.KeyName := ScSSHClient1.HostName;
ScSSHClient1.KeyStorage.Keys.Add(Key);
Key.Free;
Accept := True;
end;
end;
Thanks, thanks, and once again... Thanks...
I am trying to use SecureBridge in order to upload a file w/ SFTP
Each attempt returns: 'SFTP server error occured: Invalid file ID'
And I cannot find any help on the error code anywhere.
Of course, strFilename conatains a valid file path.
I have no problem doing the upload using i.e. filezilla and the same credentials I use programmatically.
Do you know what could be wrong?
Code is very simple:
ScSSHClient1.HostName := strHostName;
ScSSHClient1.User := strUsername;
ScSSHClient1.Password := strPassword;
ScSSHClient1.KeyStorage := ScFileStorage1;
ScSSHClient1.Connect;
ScSFTPClient1.Initialize;
ScSFTPClient1.UploadFile(strFilename, ExtractFileName(strFilename), False);
procedure TfrmMain.ScSSHClient1ServerKeyValidate(Sender: TObject; NewServerKey: TScKey; var Accept: Boolean);
var
Key: TScKey;
fp, msg: string;
begin
Key := ScSSHClient1.KeyStorage.Keys.FindKey(ScSSHClient1.HostName);
if (Key = nil) or not Key.Ready then begin
NewServerKey.GetFingerPrint(haMD5, fp);
Key := TScKey.Create(nil);
Key.Assign(NewServerKey);
Key.KeyName := ScSSHClient1.HostName;
ScSSHClient1.KeyStorage.Keys.Add(Key);
Key.Free;
Accept := True;
end;
end;
Thanks, thanks, and once again... Thanks...