Articles in this section

How to use FTP to upload files

Upsun supports sftp, but the following limitations apply:

  • You can only create sftp accounts with an existing Upsun user and an SSH key. Custom users and passwords aren’t supported.
  • sftp access 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 "$(upsun ssh --pipe)"

When prompted, select the project and environment you want to connect to. The sftp connection is open once the sftp> prompt is displayed in your terminal.

Download a file 

Say you want to download a diagram.png file from the web/uploads directory (relative to the app root). To do so, run the following command:

sftp> get web/uploads/diagram.png

The diagram.png file is copied to the current local directory.

Upload a file 

Say you want to upload a diagram.png file to the web/uploads directory (relative to the app root). To do so, run the following command:

sftp> put diagram.png web/uploads

Using a visual SFTP Client (FileZilla, Cyberduck, etc.)

If you want to use a GUI application like FileZilla to drag and drop files, you will need to connect via SFTP using your Upsun SSH keys.

  1. Ensure your public SSH key is added to your Upsun account.

  2. Run the following command to get your environment's SSH URL:

     
    upsun ssh --pipe
    

    This will output a string that looks like: u2dapcb6prp3e-main-7rqtwti@ssh.us-3.platformsh.site

  3. Configure your SFTP client:

    • Protocol: SFTP

    • Host: ssh.us-3.platformsh.site (The part after the @ symbol)

    • Username: u2dapcb6prp3e-main-7rqtwti (The part before the @ symbol)

    • Password: (Leave blank, authentication is handled by your SSH key)

Once connected, you will only be able to upload files into the specific directories you have defined as mounts in your .upsun/config.yaml.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.