Upload to storage
upload_to_storagePut files from disk into a project's bucket (add_storage), with no server involved. Use it for a static site's images, videos, and downloads such as installers, which keep the deploy bundle under its 20 MiB cap, and to seed any app's bucket with files. First deploy_project, then add_storage (public: true for files the site links to), then this: pass project_id and the files' paths relative to the folder the command will run from, and run the returned command with bash from that folder. It PUTs each file straight to the bucket over a signed URL that works for 30 minutes; the key never leaves spawnpoint. Each path is the file's key in the bucket: on a public bucket the file is then readable by anyone at the url the answer gives for it, which is what the site's HTML links to; on a private bucket only the app's own key reads it. At most 50 files per call (call again for more), each of any size the plan's bucket limit allows. Refused while the bucket is over that limit. Uploading to a key that exists replaces the file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | paths of the files to upload, relative to the folder the returned command runs from, such as img/logo.png or downloads/app.zip; each path becomes the object's key in the bucket, so it is read at <public_url>/<path> on a public bucket. Letters, digits, dots, dashes, underscores, and slashes; no spaces. At most 50 per call | |
| project_id | Yes | the id of the project that has the bucket |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| files | Yes | ||
| bucket | Yes | ||
| public | Yes | ||
| command | Yes | ||
| warning | No | ||
| expires_at | Yes | ||
| project_id | Yes | ||
| public_url | No |