Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Error downloading file in in directory

First, make sure you are using forward slashes for remote file.
sebasv

Error downloading file in in directory

Hello,

im having a problem with the DLL + Exe in VB 2010 (Express).
I can download a file without a problem as long as its in the home directory.
As soon as i put it in a directory it fails with an exception: can not get attributes, file not found.
Tested with FreeNAS ftp server and Local Filezilla server.


Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = Protocol.Ftp
.HostName = "localhost"
.UserName = "support"
.Password = "password!"
End With
Using session As Session = New Session
session.ExecutablePath = Application.StartupPath & "\Tools\WinSCP.exe"
session.DebugLogPath = "c:\debug.txt"
session.SessionLogPath = "c:\session.txt"
session.Open(sessionOptions)

Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Binary

Dim transferResult As TransferOperationResult
transferResult = session.GetFiles("\testje\update.txt", "C:\Test\Document.txt")

transferResult.Check()
End Using