I know how to get remote file via sftp.
sftp email@example.com:/path/to/file.txt localfile.txt
How can i upload file to remote server?
(I need use this command in my bash script.)
Also think about using SSH public/private keys which can avoid you to have to enter a password for your automated file exchanges.
You can use the command "ssh-keygen" to generate those keys.