Topic "VB code doesn't transfer files, why?"

Author Message
sl8rz
[View user's profile]

Joined: 2011-05-23
Posts: 2
Location: Utah, USA
I've installed winscp (Version 4.3.2_bld_1201) on my desktop (Win XP) and it works fine (I am able to connect to a secure SFTP address, transfer files, etc.). However, when I use WinSCP in my VB code it doesn't move any files up to the ftp site. I believe it connects but can not be sure. The log is created successfully but has no real data in it (just the XML header).


A few points:

* When successfully connecting with the GUI, I have to accept the key being offered by the target sftp site (I just click OK). I'm not sure if my code does this...I haven't coded anything along those lines except for the "option confirm on" in my VB code.

* When running the VB.Net code there's no errors when the winscp object starts, connects or uses the PUT command.

* The log file (log.xml) is created by the VB code , however it only has the basic pre-connection header in it after the whole process finishes.

* The winscp.exitcode always resolves to something other than 0 (an error) but .NET never raises an error.

Note: When successfully connected using the GUI, SFTP-3 is shown as the protocol being used.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please start with this FAQ:
https://winscp.net/eng/docs/faq_scheduler

Also temporarily switch to plain text log file to see what's going wrong.
sl8rz
[View user's profile]

Joined: 2011-05-23
Posts: 2
Location: Utah, USA
prikryl wrote:
Please start with this FAQ:
https://winscp.net/eng/docs/faq_scheduler

Also temporarily switch to plain text log file to see what's going wrong.



I read through the faq and adopted the "hostkey open" and "certificate open" switches. The result is the same though.
My open statement is as follows: "open sftp//myUserName:myPassword@ftp://sftp.myPlace.com"

Note: I am not running this in a scheduler or on a different machine. This is running in .Net (debug mode) on the same machine that I use to connect using the winSCP GUI.


What am I missing??

Thanks a lot,
David
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
sl8rz wrote:
My open statement is as follows: "open sftp//myUserName:myPassword@ftp://sftp.myPlace.com"

What did you based this syntax on? (asking just so that I can improve the doc if necessary)

Should probably be:
open sftp://myUserName:myPassword@sftp.myPlace.com
or
open sftp://myUserName:myPassword@myPlace.com
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License