Page 1 of 1
ScSFTPClient DownloadFile error
Posted: Thu 03 Apr 2014 06:20
by cassavetes14
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
Re: ScSFTPClient DownloadFile error
Posted: Fri 04 Apr 2014 14:49
by Dimon
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.
Re: ScSFTPClient DownloadFile error
Posted: Fri 04 Apr 2014 17:39
by cassavetes14
Thank You very much, I will try it
Re: ScSFTPClient DownloadFile error
Posted: Tue 08 Apr 2014 23:02
by cassavetes14
Does not work: I get a download error.
Re: ScSFTPClient DownloadFile error
Posted: Wed 09 Apr 2014 12:40
by Dimon
Please, specify the exact step from the post above when the problem is reproduced.
Re: ScSFTPClient DownloadFile error
Posted: Fri 05 Feb 2016 02:00
by Pasquina
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
Re: ScSFTPClient DownloadFile error
Posted: Fri 26 Feb 2016 10:40
by ViktorV
Thank you for the information. We will investigate this behavior of SecureBridge.
Please specify the exact SFTP server version you are using.