Solved

SFTP file transfer using Vb.Net

Posted on 2014-09-24
7
1,018 Views
Last Modified: 2014-09-25
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 ?
0
Comment
Question by:chokka
  • 3
  • 3
7 Comments
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
Comment Utility
one simply does a 'cd \diredtory or cd ~\directory for remote and a ldir drive:path
0
 

Author Comment

by:chokka
Comment Utility
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
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:chokka
Comment Utility
@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 ??
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
all the tools can navigate but they all do it differently!
0
 

Author Comment

by:chokka
Comment Utility
@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 ???
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
Comment Utility
it will also depends on the permission you have on that server. many times, s/ftp users are very limited to specifics folders on the server.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now