TScSFTPClient.UploadFile raises EScError for empty files

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
ajoschi
Posts: 15
Joined: Thu 14 Oct 2010 11:46

TScSFTPClient.UploadFile raises EScError for empty files

Post by ajoschi » Thu 12 Apr 2018 12:52

Hi,

Is it a known issue/behavior of TScSFTPClient.UploadFile() that EScError is raised in case the file to upload is an empty file (0 Bytes)?

My code (simplified):

Code: Select all

procedure Updload(const pLocalFileFullPath, pNewFileFullPath: String; const pScSSHClient: TScSSHClient);
var
  lScSFTPClient: TScSFTPClient;
begin
  lScSFTPClient := TScSFTPClient.Create(nil);
  try
    lScSFTPClient.SSHClient := pScSSHClient;
    lScSFTPClient.Initialize;
    lScSFTPClient.UploadFile(pLocalFileFullPath, pNewFileFullPath, True);
  finally
    lScSFTPClient.Free;
  end;
end;
Exception with related call stack:

Code: Select all

exception class    : EScError
exception message  : Invalid file handle.

main thread ($8cc):
018e95c5 Project.exe ScSFTPClient              706   +9 TScSFTPClient.FindFileItem
018eba15 Project.exe ScSFTPClient             1358   +1 TScSFTPClient.InitRequestByHandle
018ecae4 Project.exe ScSFTPClient             1794   +1 TScSFTPClient.CloseHandle
018ec7f5 Project.exe ScSFTPClient             1646  +18 TScSFTPClient.InternalUpload
018ec55b Project.exe ScSFTPClient             1620  +43 TScSFTPClient.OpenAndUploadFile
018ec366 Project.exe ScSFTPClient             1560   +4 TScSFTPClient.UploadFile
Additional Info:
SecureBridge v8.1.3
Delphi RAD Studio 10.2 (Release 3)
Applies to 32 and 64 bit builds


Thx, Ajoschi!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TScSFTPClient.UploadFile raises EScError for empty files

Post by ViktorV » Fri 13 Apr 2018 10:27

Thank you for the information. We have reproduced the problem and it will be fixed in the next build.

ajoschi
Posts: 15
Joined: Thu 14 Oct 2010 11:46

Re: TScSFTPClient.UploadFile raises EScError for empty files

Post by ajoschi » Fri 13 Apr 2018 11:22

Thank you Viktor,

Would it be possible to get a prerelease including this fix (source code would be sufficient), or provide the necessary modifications in source code?

Best regards,
Ajoschi

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TScSFTPClient.UploadFile raises EScError for empty files

Post by ViktorV » Fri 13 Apr 2018 11:31

As soon as we have a stable night build, we will be able to send it to you. Please provide your license number and IDE version to us and we will send you a night build.

ajoschi
Posts: 15
Joined: Thu 14 Oct 2010 11:46

Re: TScSFTPClient.UploadFile raises EScError for empty files

Post by ajoschi » Fri 13 Apr 2018 14:51

Thank you Viktor!

I just send you the license number view e-support.

Best regard,
Ajoschi

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TScSFTPClient.UploadFile raises EScError for empty files

Post by ViktorV » Thu 19 Apr 2018 14:16

We have answered you via e-mail.

ajoschi
Posts: 15
Joined: Thu 14 Oct 2010 11:46

Re: TScSFTPClient.UploadFile raises EScError for empty files

Post by ajoschi » Thu 19 Apr 2018 15:02

Thank you Viktor!

I can confirm the issue no longer exists in the night build you provided.

Best regards,
Ajoschi

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TScSFTPClient.UploadFile raises EScError for empty files

Post by ViktorV » Thu 19 Apr 2018 15:03

It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about our products.

Post Reply