Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MatthewSabia1/Joip-Web-App-2/llms.txt
Use this file to discover all available pages before exploring further.
This endpoint requires authentication. Users must be logged in to upload media files.
Overview
Upload media files to your personal Media Vault. Files are stored in Supabase Storage with automatic organization into folders based on the source parameter.Request
Headers
- Content-Type:
multipart/form-data - Cookie: Session authentication cookie
Form Data Parameters
The media file to upload. Supported formats:
- Images: JPEG, PNG, GIF, WebP
- Videos: MP4, WebM
The source or category for organizing the uploaded file. Determines the folder structure in storage.Options:
general- General uploads folderprofile- Profile images folderthumbnail- Thumbnail images foldersmart-caption- Smart Captions folderbabecock- Babecock Studio folderhypnococks- HypnoCocks folder
File Upload Requirements
Allowed MIME Types
Allowed File Extensions
Security Validations
- Path traversal characters (
..,/,\\) are not allowed in filenames - Special characters in filenames are sanitized and replaced with underscores
- Filenames are prefixed with timestamp and source to prevent conflicts
Storage Integration
Supabase Storage Structure
Files are organized in theuser-media bucket with the following structure:
source: "general"→General/source: "profile"→Profile/source: "thumbnail"→Thumbnails/- Other sources →
{Source}/
Example File Path
Response
The public URL of the uploaded file in Supabase Storage
The unique filename generated for the uploaded file (includes timestamp and sanitization)
The full storage path of the file in the format:
users/{userId}/{FolderName}/{fileName}The source parameter that was provided in the request
Success Response Example
Error Responses
400 Bad Request
No file uploaded:500 Internal Server Error
Storage error:503 Service Unavailable
Storage not configured:Example Usage
cURL
JavaScript (Fetch API)
React Example with Preview
Notes
- All uploads are tracked in user activity logs with action
media_uploaded - The maximum upload size can be configured by admins via app settings
- Files are automatically validated for MIME type and file extension
- Duplicate filenames are prevented by adding timestamps
- Uploaded files can be accessed immediately via the returned public URL