Skip to content

A demo app that will upload a file to an SFTP server using Node

Notifications You must be signed in to change notification settings

briantanseng/sftp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sftp-demo

Checkout the code & navigate to the project directory

git clone [email protected]:briantanseng/sftp-demo.git && cd sftp-demo

Setup the environment variables

Create a file called setenvs.sh. Add the needed values

       │ File: setenvs.sh
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ export SFTP_SERVER='IP_ADDRESS_OF_YOUR_SFTP_SERVER';
   2   │ export SFTP_PORT='PORT_NUMBER';
   3   │ export SFTP_USER='USERNAME';
   4   │ export PRIVATE_KEY='./id_rsa';

Load the environment variables

source setenvs.sh

Run the project

node index.js

Sample output

Uploaded data stream to /home/username/sample-data.csv <-- Success!

About

A demo app that will upload a file to an SFTP server using Node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published