Upload control with signed uploads
Signed uploads restrict who can upload files to your Uploadcare project, and for how long. They work with File Uploader, jQuery File Uploader (deprecated), and Upload API.
Enable signed uploads
- Go to your Dashboard and select an existing project or create a new one.
- Click Enable next to Signed Uploads in the uploading settings.
Once enabled, every Upload API request must include a signature and expire.
How it works
Your backend computes an HMAC-SHA256 signature of the expire timestamp using your project’s secret key, then sends both signature and expire as request parameters with the upload request. Upload API recomputes the same signature and compares — if it doesn’t match, or is missing, the upload is rejected.
Generate a signature
The signature is a hex-encoded HMAC-SHA256 digest:
- Key: your project’s secret key (from the API keys section), UTF-8 encoded
- Message: the
expirevalue as a decimal string (e.g."1700000000")
@uploadcare/signed-uploads package accepts milliseconds and converts to seconds internally. If you implement signing without this package, expire must be a Unix timestamp in seconds — not milliseconds.Here’s how to generate the signature on your backend:
JavaScript
NodeJS
Python
Ruby
Elixir
Expiration
The expire value is a Unix timestamp in seconds that defines when the signature expires.
Upload example
Request:
Response:
File Uploader integration
For File Uploader, set the secure signature and secure expire options directly, or use secureUploadsSignatureResolver to fetch a fresh signature automatically as it nears expiration.
Errors
For the complete list of Upload API errors, see the Upload API errors.