Signed links
Let a browser or another service download or upload one file, for a limited time, without your API key.
Your API key must stay on your servers. To let someone else's browser fetch or send a single file, your server signs a link for just that file and hands over only the link.
Download links
A download link works for up to 24 hours. With disposition=attachment the browser saves the file instead of opening it. Files a browser would run (HTML, SVG, XML and script) are always downloaded and never shown in the browser, whichever you choose.
curl -X POST "https://api.teepin.com/v1/storage/buckets/my-bucket/object/download-url?key=report.pdf&ttl_seconds=900&disposition=attachment" \
-H "Authorization: Bearer $TEEPIN_API_KEY"Upload links
An upload link allows one upload to one key, works for up to an hour, and can cap the size (at most 5 GiB) and fix the content type.
up = client.storage.presign_upload("my-bucket", "avatars/ana.png",
ttl_seconds=600, max_bytes=5 << 20, content_type="image/png")
# The browser sends one PUT to up.url with up.headers.Links can't be taken back
A signed link is valid until it expires, even if you change your mind. Keep lifetimes as short as the job allows. Downloads through a link are billed to your account like any other download.
S3 presigned URLs
The S3 endpoint also accepts standard S3 presigned URLs, so aws s3 presign and the AWS SDKs' presigners work too.