Skip to content

Managing Upload Keys

Upload Keys are Public

Upload keys are safe to use in frontend code and client-side applications. They're designed for temporary image uploads from browsers with origin restrictions for security.

Upload Key Structure

Upload keys are used directly in the upload URL path:

javascript
const uploadKey = "upl_abc123def456...";
const response = await fetch(`/api/v1/upload-temporary-image/${uploadKey}`, {
  method: "POST",
  headers: { "X-Original-Filename": file.name },
  body: file,
});

Find Your Upload Keys

  1. Go to your project dashboard
  2. Navigate to the "Upload Keys" tab
  3. View all upload keys for the current project
  4. Copy the key you need for your application

Create a New Upload Key

  1. In your project dashboard, go to "Upload Keys"
  2. Click "New Upload Key"
  3. Give it a descriptive name (e.g., "Frontend App", "Mobile Upload")
  4. Configure allowed origins for the new key

Configuring Allowed Origins

Upload keys use origin restrictions for security:

  1. Find the upload key in your project dashboard
  2. Click "Edit Origins"
  3. Add allowed origins (e.g., https://example.com, http://localhost)
  4. Save the changes

The server validates the Referer header against these origins on each upload.

See Allowed origins for more information.

Configuring Temporary Image Expiry Time

Under project settings, you can configure the amount of hours temporary images are stored for.