Skip to main content

Temp Upload

Exposes a POST endpoint that accepts a multipart file upload, stores it via the registered file storage adapter in the temp-uploads directory, and returns a download URL. Uploaded files expire after 24 hours.

This is a routes-only plugin — it registers no adapter, just the HTTP endpoint.

Included in Base Preset

Registered automatically by registerBasePlugins() / registerAllPlugins().

Registration​

import { pluginRegistry } from '@unchainedshop/core';
import { TempUploadPlugin } from '@unchainedshop/plugins/files/temp-upload';

pluginRegistry.register(TempUploadPlugin);

Endpoint​

POST /temp-upload

The file is read from the file form field (falls back to the first file field in the form):

curl -X POST http://localhost:4010/temp-upload -F file=@image.png

The request must be authenticated and pass the uploadTempFile permission check. The default loggedIn role grants it to users with a verified email address; the all (anonymous) role denies it.

Response:

{
"fileId": "...",
"url": "...",
"expires": "2026-08-27T12:00:00.000Z"
}
StatusMeaning
200Upload succeeded
400No file in the form data
403Missing uploadTempFile permission
503Upload or URL generation failed

Environment Variables​

VariableDefaultDescription
TEMP_UPLOAD_API_PATH/temp-uploadPath the endpoint is mounted at

Plugin Details​

PropertyValue
Keyshop.unchained.files.temp-upload
Version1.0.0
Sourcefiles/temp-upload