Upload File
Upload a file to ClassQuiz storage.Request Body
File to upload (multipart/form-data)
Authentication
RequiredSupported File Types
- Images:
image/jpeg,image/png,image/gif,image/webp,image/svg+xml - Other allowed MIME types as configured
Response
Unique file ID
Upload timestamp
File MIME type
File content hash (hex)
File size in bytes
Alt text for accessibility
Original filename
Thumbnail hash for blur placeholder
Example Response
Error Codes
422: Unsupported file type409: Storage limit reached
Upload Raw File
Upload raw file data via request body (streaming).Request Body
Raw file bytes streamed in request body.Headers
MIME type of the file
Authentication
RequiredResponse
Same as standard file upload endpoint.Download File
Download a file by its name or ID.Path Parameters
File name or UUID with optional user ID (format:
uuid--user-uuid)Response
Returns file stream with appropriate headers:Content-Type: File MIME typeCache-Control:public, immutable, max-age=31536000X-Hash: File content hashX-Thumbhash: Thumbnail hashX-Alt-Text: Base64-encoded alt textContent-Size: File size in bytes
S3 Backend
If using S3 storage, returns a redirect (302) to a signed URL valid for 300 seconds.Get File Info
Get file metadata without downloading the file.Path Parameters
File name or UUID
Response
Returns HTTP 200 with headers containing file metadata (same as download endpoint).File Metadata (HEAD)
Get file metadata using HEAD request.Path Parameters
File name or UUID
Response
Returns headers only, no body. For S3 storage, returns 307 redirect.Get File Metadata
Get detailed metadata for a file.Path Parameters
File UUID
Authentication
Required - Must be file ownerResponse
Returns public storage item object (see Upload File response).Update File Metadata
Update file metadata (alt text, filename).Path Parameters
File UUID
Request Body
Accessibility alt text (empty string to remove)
Display filename (empty string to remove)
Authentication
Required - Must be file ownerExample Request
Delete File
Mark a file as deleted (soft delete).Path Parameters
File UUID
Authentication
Required - Must be file ownerResponse
Returns HTTP 200. File is marked withdeleted_at timestamp and removed from storage backend.
List Files
List user’s uploaded files.Query Parameters
Only return files uploaded after this date (default: 9999 weeks ago)
Authentication
RequiredResponse
Array of private storage items:File ID
Upload timestamp
File MIME type
File size in bytes
Array of quiz IDs using this file
Array of quiztivity IDs using this file
Example Response
Get Latest Files
Get the most recently uploaded files.Query Parameters
Number of files to return (max 50)
Authentication
RequiredResponse
Array of private storage items (same format as List Files).Get Storage Limit
Get user’s storage usage and limit information.Authentication
RequiredResponse
Storage limit in bytes
Whether storage limit has been exceeded
Storage used in bytes
Example Response
Storage Best Practices
File Naming
Files are stored with UUID-based names. The system supports two formats:- Simple UUID:
123e4567-e89b-12d3-a456-426614174000 - UUID with user:
file-uuid--user-uuid
Caching
Files are served with aggressive caching headers (max-age=31536000). Files are immutable once uploaded.
Deduplication
The system calculates file hashes asynchronously. Identical files can be deduplicated based on content hash.ThumbHash
Images are processed to generate ThumbHash - a compact representation for blur placeholders while the image loads.Storage Backends
ClassQuiz supports multiple storage backends:- Local filesystem: Files served directly
- S3-compatible: Returns signed URLs for direct access