GetFile() does nothing - WeOnlyDo Discussion board

GetFile() does nothing (wodSFTP / wodSFTP.NET / wodSFTPdll)

by EMRDeveloper, Friday, September 02, 2011, 18:37 (4831 days ago)

VB.Net, Visual Studio 2008, .Net Framework 3.5 SP1,
SFTP DLL version 3.3.8.94

I can connect to a SFTP server and list files successfully, but when I go to download with GetFile(), nothing is downloaded. No error message. If I set the .Blocking property to True, the GetFile() command goes into an infinite loop. I've tried using several different directories for the local path, removing the / from the remote path, and setting the local and remote path before calling GetFile.

The file is a small .RMT file - I've tried binary and ASCII mode.

Code:

Dim WithEvents sftp1 As WeOnlyDo.Client.SFTP
sftp1 = New WeOnlyDo.Client.SFTP
sftp1.LicenseKey = <details removed>
sftp1.Port = 22
sftp1.Hostname = Me.HostName
sftp1.Login = Me.UserName
sftp1.Password = Me.Password
sftp1.Timeout = 1500
sftp1.Connect()

sftp1.GetFile( C: , CurDir & / & FileName)

(I see that the formatting of this forum removed the backslash after C: )

Re: GetFile() does nothing

by wodDamir, Friday, September 02, 2011, 19:01 (4831 days ago) @ EMRDeveloper

Hi,

The code you provided can't really work without Blocking mode set to true. If no blocking is set, then you would need to handle events (i.e. Connected event) and use them to call GetFile and other methods.

When blocking mode is set, each method will block code execution until component receives an error, or is done with execution. Only then will code be released and will continue with the next line.

How big is the file you're trying to download? Are you sure it's a hang that you're experiencing, and not component actually downloading the file?

Regards,
Damba

Re: GetFile() does nothing

by EMRDeveloper, Friday, September 02, 2011, 19:22 (4831 days ago) @ wodDamir

Thanks for the prompt response, Damba.

I set Blocking = True, then I have waited up to five minutes for GetFile to execute on file that is less than 1 KB.

If Blocking = True, even the .Connect method never finishes executing. Seems like this should be simple to get a single file.

Re: GetFile() does nothing

by wodDamir, Friday, September 02, 2011, 19:43 (4831 days ago) @ EMRDeveloper

Hi,

It actually is. However, you seem never to connect. Can you connect to that server using SFTP protocol using any other client?

Can you try the sample code from here:

http://example.weonlydo.com/index.asp?did=Download-file-using-SFTP-protocol

If that doesn't work, is there any chance we could connect to that host and reproduce the issue?

Regards,
Damba

Re: GetFile() does nothing

by EMRDeveloper, Friday, September 02, 2011, 19:48 (4831 days ago) @ wodDamir


With Filezilla we can connect to the host with the same credentials and download the file in less than a second.

The sample code does not work - setting the Blocking = True causes an infinite loop when we try to connect.

How can I send you the server credentials without posting them in an open forum like this one?

Re: GetFile() does nothing

by wodDamir, Friday, September 02, 2011, 20:08 (4831 days ago) @ EMRDeveloper

Hi,

You can simply send us an e-mail with credentials to techsupport@weonlydo.com

Anything you send there is private.

Regards,
Damba

Re: GetFile() does nothing

by EMRDeveloper, Friday, September 02, 2011, 22:04 (4831 days ago) @ wodDamir


Sent e-mail - thank you.