Link to home
Start Free TrialLog in
Avatar of chokka
chokkaFlag for United States of America

asked on

SFTP file transfer using Vb.Net

I am working on VS 2012, Vb.Net and transferring / creating a .csv file in the Linux server through SFTP Connection. I have two options, either to go with Chilkat SFTP dll or with SecureFX sftp file transfer.

As our existing project which takes the data in a  byte array variable and creates the file in the Linux Server using FTP connection, we decided to use the existing functions and change the syntax only for SFTP. So, we are not transferring the file. We are creating a file in the Linux Server using SFTP connection.

Using this sample code, I am able to WriteFileBytes in the Linux Server :

http://www.example-code.com/vbdotnet/sftp_writeBinary.asp

But what happens is the file is written in the Root directory of the server. \home\<User_Id>

\home\<User_id> is the Root directory for Linux

and for windows this will be C:\<User_Id>

Once the file is created, i have to move the file from Root Directory to our Specified file location.

Using this sample code : http://www.example-code.com/vbnet/ssh_exec.asp

My question is, Is it difficult to Transfer or Write file in Any Servers ( Linux or Windows ) to a specified file location ???

If possible, What would be the steps i have to follow to directly go to the specified file location ?
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

one simply does a 'cd \diredtory or cd ~\directory for remote and a ldir drive:path
Avatar of chokka

ASKER

I'm sorry , I'm not able to get your answer. This is not just a remote connection. I have to connect through SFTP. This is linux
Avatar of chokka

ASKER

@Eric, Thank you !! I am aware about basics mentioned in the link. I have already developed the prototypes using Chilkat sftp and SecureFX sftp.

My Question is, Irrespective of whatever third party dll's we implement in the .Net Project, when we do the File Transfer, Do the files will be transferred only to the Root directory of the user's sftp authentication (Or), Files can be transferred to any where by mentioning the absolute Path ??
all the tools can navigate but they all do it differently!
Avatar of chokka

ASKER

@Eric, My understanding from you is, Nothing to do with SFTP in Linux Server. It's all about Third Party Tools. So we can transfer the file directly to any specific folder in the Linux Server through SFTP connection.

Am i right ???
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial