SFTP UploadFile error 'File not found'

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
PhilW
Posts: 2
Joined: Fri 29 May 2015 13:46

SFTP UploadFile error 'File not found'

Post by PhilW » Fri 29 May 2015 14:13

Hello,

I am evaluating the SFTP components (6.5.8 05-May-15) using Delphi XE; following the demo code closely. Connection and Initialize is working well, thank you, but a test of uploading files, such as:

Code: Select all

ScSFTPClient1.Uploadfile('C:\Users\Phil\Documents\afile.txt', '/RandDT_UK/C1122/afile.txt', True);
fails with the error: 'File not found'.

(Yes, the client is a Windows PC, and the FTP server is running on (L)Unix). Any thoughts?

As a general question, how can I access the response text from the SFTP server? This would be very useful for debugging purposes at least.

By the way, the Delphi IDE is not happy with the creation of the ScSFTPClient OnSuccess event - the errror is:

Code: Select all

EParseError : Expected '>' but '.' found.
I think there is a minor problem with the generics declaration in 'const Handle: TArray<System.Byte>'

Thanks for a great set of components, and thanks for any advice.
Kind regards
PhilW.

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

Re: SFTP UploadFile error 'File not found'

Post by ViktorV » Tue 02 Jun 2015 13:12

The "File not found" occurs, when the system can't find the file on a client machine for upload . Please check whether the issue is reproduced on our SFTPClient demo project, that can be found in the 'Demos\SFTPClient' folder relatively to the SecureBridge for RAD Studio XE demos installation path.
The "EParseError : Expected '>' but '.' found." error is a known problem of the Delphi XE compiler, and we can't influence it. As a workaround, you can change TArray<System.Byte> to TBytes or TScSFTPFileHandle and assign the event handler in code at run-time instead of assigning it at design-time.

PhilW
Posts: 2
Joined: Fri 29 May 2015 13:46

Re: SFTP UploadFile error 'File not found'

Post by PhilW » Mon 22 Jun 2015 15:30

Hi Viktor,

Thank you for your quick response; I apologise for my late response, I was assigned to a different project and only now have some spare time to progress this issue. Yes, the same error occures in the demo program, line 595 of SFTPClientFrame:

Code: Select all

ScSFTPClient.UploadFile(OpenDialog.FileName, GetRootDir + ExtractFileName(OpenDialog.FileName), False);
The EScSFTPError is: SFTP server error occured: File not found.

Does the demo program work for you?

Thanks for the workround for the OnSuccess event, I'll try that next.

Kind regards
PhilW.

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

Re: SFTP UploadFile error 'File not found'

Post by ViktorV » Tue 23 Jun 2015 10:45

Unfortunately, we couldn't reproduce the issue on our SFTPClient demo project. For the issue investigation, if it is possible, please give us test access to your server. Otherwise, specify the used versions of the OS and SFTP server.

Post Reply