File uploads

How to upload and download files from pico services

Table of Contents

All of our services require users to send us files in order to manage content. Read the How it Works for an under-the-hood, technical summary.

How do I upload files? #

Unless otherwise specified, all our services support the following ways to upload files.

rsync #

1rsync {service}:/

For pgs:

1rsync -rv public/ {service}:/site/

What rsync options are supported? #

Because in our Go SSH server we re-implement rsync, many options are currently not supported. For example, --delete and --dry-run are not supported. At this time, the only options we supported are the following:

  • -r
  • -v

scp #

There are two versions of scp, depending on your openssh version. Anything < v9.0 used "legacy scp." Anything >= v9.0 uses sftp.

1scp {service}:/

for pgs:

1scp -R public/ {service}:/site/

sftp #

1sftp {service}
3sftp> ls
6sftp> rm
8sftp> put
1echo 'put' | sftp {service}

sshfs #

Requirement: sshfs

sshfs will allow users to mount their blog and sites like any other drive. So you'll be able to view, edit, create, remove, and move folders and files like a normal filesystem!

Some use cases we think are impactful:

  • Debug production sites
  • Run cli commands on your production sites
  • Grep/find files across all your sites
  • Create a development site that you use as a pgs dev server
  • Make quick edits to a blog post live
  • Run a formatter on your blog posts
  • Easier and faster than git-ops (add+commit+push+wait-for-cicd)

blog with prose #

mount your blog:

1mkdir ~/blog
2sshfs ~/blog
3# edit files using your favorite editor
4nvim ~/blog/
5# changes are published live!
7# unmount
8umount ~/blog

sites with pages #

mount your sites:

1mkdir ~/sites
2sshfs ~/sites
3# edit files using your favorite editor
4nvim ~/sites/myproj/index.html
5# changes are published live!

mount a single site:

1# image you have a static-site builder
2cd ~/my_site
3# mount your ssg's output folder
4sshfs ./public
5# edit files using your favorite editor
6nvim tmpl/base.html
7# run ssg build command
8# changes are published live!

So what's the downside? Well it's a little slower than a hard drive on your machine. We are still experimenting with the technology so quirks or bugs might come up. We would love to get your feedback.

How do I update files? #

Just send us the files you want to update. With you can upload single files to projects, but we also support "deploying" static sites with promotion and rollback.

How do I delete files? #

The easiest way to delete a file is via sftp.

1sftp {service}
2sftp> rm

You could also mount our services via sshfs and then delete it that way.

How do I download files? #

Using the same tools described here, just reverse the order of src and dest!

1rsync .
How it works