put - Upload a file from your local machine to the server in SFTP

You can upload a file from local to the remote server by "put" command.

psftp> put filename

Using put command you can only upload a single file at a time.

SFTP expects local path and remote path from the user before uploading since it is a file transfer.
If user does not specify anything, the default paths will be taken automatically by PSFTP.

psftp> put file1.sh

The above code will upload the file file1.sh from the default local path (if exists) and put it in the remote default path.

psftp> pwd
current remote working directory is /home/user1
psftp> cd /mine/files/level
new remote working directory is /mine/files/level
psftp> lpwd
current local working directory is C:\Documents and Settings\Desktop
psftp> lcd C:\folder1
new local working directory is C:\folder1
psftp> put file1.sh

Since the remote and local paths are already defined, the above code will upload the file1.sh from C:\folder1 to /mine/files/level