scp or rsync.
Transfer files using the CLI
View the mounts inside your app
Before you start transferring files, you may want to view a list of all the mounts inside your app. To do so, run the following command:Transfer a file to a mount
To transfer a file to a mount using the CLI, you can use themount:upload command.
For example, to upload the files contained in the local private directory to the private mount,
run the following command:
Transfer a file from a mount
To transfer a file from a mount using the CLI, you can use themount:download command.
For example, to download a file from the private mount to your local private directory,
run the following command:
Transfer files using an SSH client
Another way to transfer files to and from your built app is to use an SSH client such asscp,
rsync, or sftp.
scp
You can usescp to copy files to and from a remote environment.
For example, to download a diagram.png file from the web/uploads directory
(relative to the app root),
run the following command:
diagram.png file is copied to the current local directory.
To copy files from your local directory to the Upsun environment,
reverse the order of the parameters:
scp documentation.
rsync
You can usersync to copy files to and from a remote environment.
For example, to copy all the files in the web/uploads directory on the remote environment
to the local uploads directory,
run the following command:
rsync is very sensitive about trailing / characters.
If you’re using UTF-8 encoded files on macOS,
add the --iconv=utf-8-mac,utf-8 flag to your rsync call.
For more options, consult the rsync documentation.
sftp
You can usesftp to copy files to and from a remote environment.
Upsun supports
sftp, but the following limitations apply:- You can only create
sftpaccounts with an existing Upsun user and an SSH key. Custom users and passwords aren’t supported. sftpaccess cannot be limited to a specific directory. Instead, access is given to the whole application directory and its mounts.
Open an sftp connection
Run the following command:
sftp connection is open once the sftp> prompt is displayed in your terminal.
Download a file
Say you want to download adiagram.png file from the web/uploads directory
(relative to the app root).
To do so, run the following command:
diagram.png file is copied to the current local directory.
Upload a file
Say you want to upload adiagram.png file to the web/uploads directory
(relative to the app root).
To do so, run the following command:
sftp documentation.