Vaulx never proxies file bytes through the application server for downloads. When a download is requested, the server validates the session and access rights, then callsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/noelzappy/vaulx/llms.txt
Use this file to discover all available pages before exploring further.
storage.PresignGET to obtain a time-limited AWS S3 presigned GET URL and immediately issues a 302 Found redirect. The browser follows the redirect and fetches the file bytes directly from S3 — the Go server is completely out of the data path after that point. This keeps bandwidth consumption on the application server near zero regardless of file size.
Download a file
302 Found redirect to that URL. The browser follows the redirect and downloads the file directly from S3.
Authentication: Required (file uploader or admin only)
UUID of the file to download. The file must exist and have
status = 'active'.302 Found — Location header set to the presigned S3 URL. The browser fetches the file directly from S3 without any further involvement from the Vaulx server.
Error responses:
| Status | Condition |
|---|---|
400 Bad Request | fileID is not a valid UUID. |
401 Unauthorized | No active session cookie. |
403 Forbidden | Authenticated user is not the uploader and is not an admin. |
404 Not Found | No file with that ID exists, or the file’s status is not active (e.g., it is pending or deleted). |
500 Internal Server Error | Presigned URL generation failed (S3 client not initialised or AWS error). |
Example: downloading with curl
Because the server returns a redirect, pass-L to make curl follow it automatically.
-L and check the Location header:
How presigned URLs work
When the download endpoint is hit, the handler callsstorage.PresignGET(ctx, file.S3Key). This function calls the AWS SDK’s PresignGetObject with a 15-minute expiry:
The 15-minute TTL is fixed for the download endpoint. If you need a shorter-lived URL (e.g., for an inline browser preview), use the preview endpoint instead, which generates a 5-minute presigned URL via
storage.PresignGETWithTTL.Preview vs. download
Both endpoints generate presigned S3 GET URLs, but they serve different purposes:Preview (GET /api/file/{fileID}/preview) | Download (GET /files/{fileID}/download) | |
|---|---|---|
| TTL | 5 minutes | 15 minutes |
| Response | HTML partial (PreviewPanel) embedding the URL | 302 redirect directly to the URL |
| Use case | In-browser inline preview panel | Force-download to disk |
| S3 function | storage.PresignGETWithTTL(ctx, key, 5*time.Minute) | storage.PresignGET(ctx, key) |
| Content-Disposition | Inline (browser decides) | Not set (S3 default) |