Upload and download
Short answer
Upload a file by sending its bytes to POST /v2/files/upload with the path it should have; missing folders are created for you. Fetch copies a file from any URL into your account. For very large files, use resumable tus uploads. Download returns the original file. Each command needs a bearer token.
After reading this you will know
- How to upload a file, or fetch one from a URL
- How to upload large files with resumable tus uploads
- How to download the original of any file
Each page has the commands for one task, with parameters, sample code in 9 languages and a sample answer.
- Upload a file POST /v2/files/upload: Upload a file.
- Fetch a file from a URL POST /v2/files/fetch: Fetch a file(s) from a URL via HTTP and save it to your Sirv account.
- Upload large files with tus 2 commands: List available tus.io locations, Get tus.io upload link. Parameters, sample code in 9 languages and sample answers.
- Download a file GET /v2/files/download: Download a single file from an account.