ScSFTPClient DownloadFile error

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
cassavetes14
Posts: 3
Joined: Thu 03 Apr 2014 06:13

ScSFTPClient DownloadFile error

Post by cassavetes14 » Thu 03 Apr 2014 06:20

When I try to use DownloadFile on a SFTP server, I get the error "The massage [file.csv] is not extractable".
On my local SFTP server all work fine, but on the real SFTP server the error is issued.
Where is the problem?
Thanks

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: ScSFTPClient DownloadFile error

Post by Dimon » Fri 04 Apr 2014 14:49

It seems, that SFTP Server cannot access a home directory.
Try to download a file step by step without using the DownloadFile method. Please follow the steps below:
1. Establish SFTP connection using the TScSFTPClient.Initialize method.
2. Open a remote file by the OpenFile method.
3. Retrieve file attributes by the RetrieveAttributesByHandle method.
4. Read the data using the ReadFile method in a loop until the file download is completed.

cassavetes14
Posts: 3
Joined: Thu 03 Apr 2014 06:13

Re: ScSFTPClient DownloadFile error

Post by cassavetes14 » Fri 04 Apr 2014 17:39

Thank You very much, I will try it

cassavetes14
Posts: 3
Joined: Thu 03 Apr 2014 06:13

Re: ScSFTPClient DownloadFile error

Post by cassavetes14 » Tue 08 Apr 2014 23:02

Does not work: I get a download error.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: ScSFTPClient DownloadFile error

Post by Dimon » Wed 09 Apr 2014 12:40

Please, specify the exact step from the post above when the problem is reproduced.

Pasquina
Posts: 2
Joined: Mon 02 Nov 2015 15:51

Re: ScSFTPClient DownloadFile error

Post by Pasquina » Fri 05 Feb 2016 02:00

I just ran into this same problem trying to download short message files from a large corporate website. The server kept giving me the annoying and useless "cannot be extracted" message. I tried the suggestion here to open a handle, retrieve the attributes and then read the file, but the "cannot be extracted" message continued. It got past the RetrieveAttributesByHandle ok, but failed on the ReadFile. I removed the RetrieveAttributesByHandle and that solved the problem. It may be that freeing and reopening the handle will allow you to get both the Attributes and Read the file, but I haven't tried that. I'm not concerned with the attributes, just the file content.

Regardless, whoever runs the server has a fairly buggy implementation of SFTP!

MV

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

Re: ScSFTPClient DownloadFile error

Post by ViktorV » Fri 26 Feb 2016 10:40

Thank you for the information. We will investigate this behavior of SecureBridge.
Please specify the exact SFTP server version you are using.

Post Reply