When I try to open the file with an incorrect path or file name I get the error "No such file"
When I try to open the file with the correct path and file name the handle has a value of "00000000".
Any insight on this issue would be greatly appreciated. Here is the code.
' Download the file: success = sftp.DownloadFile(handle, "localPath/") If (success <> True) Then MsgBox(sftp.LastErrorText) GoTo CloseFexCoData Else MsgBox("File downloaded") End If
CloseFexCoData: success = sftp.CloseHandle(handle) If (success <> True) Then MsgBox(sftp.LastErrorText) Exit Sub Else MsgBox("Disconnect OK") End If
asked Nov 20 '15 at 15:58
Why is this a problem? The handle is "00000000". It should be a valid handle when passed to DownloadFile and CloseHandle...
answered Nov 20 '15 at 16:14
Thank you for the quick response.
I am new to this. Your reply made me look closer at the destination for the download and there was an incomplete path. I thought the file name opened would land in the destination with specifying the actual name.
For testing I used the actual file name. When in production I will need to use a wild card to get the file. Can I use the wild card in the destination file name or is there a way to capture the full name of the file opened?
Thank you, Barry
answered Nov 23 '15 at 08:22