How to upload a file from the command line with FTP or SSH?

You can use scp to copy to a remote machine.

scp <file to upload> <username>@<hostname>:<destination path>

You're probably looking for SCP or similar.

#!/bin/bash

cd ./files-to-upload
scp * user@host:/path/to/upload/files/to

of course this must be tweaked to your liking.Replace user@host with your real information. You will be prompted for a password to upload.