Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SFTP file transfer using Vb.Net

Posted on 2014-09-24
7
Medium Priority
?
1,337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 83

Expert Comment

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

Author Comment

by:chokka
ID: 40342964
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 70

Expert Comment

by:Éric Moreau
ID: 40342988
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:chokka
ID: 40344083
@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 70

Expert Comment

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

Author Comment

by:chokka
ID: 40344526
@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 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 40344615
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Hello to you all, I hear of many people congratulate AWS (Amazon Web Services) on how easy it is to spin up and create new EC2 (Elastic Compute Cloud) instances, but then fail and struggle to connect to them using simple tools such as SSH (Secure…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

722 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