📤 Public API: File Upload
This API allows users to upload image and video files to SelfGoneFile's infrastructure. After upload, it returns public access URLs and a secure deletion link.
🔐 Authentication
This endpoint is public. No token or key is required. However, rate limiting is enforced per IP using Redis.
📦 Request Format
Use multipart/form-data
for the request body.
file
: Required. The binary file to upload.storage_duration
: Required. Lifetime of the file. Must be one of:1d
,7d
,1m
,12m
.
📎 Example with curl
curl -X POST https://api.selfgonefile.com/api/upload \ -F "file=@./test.gif" \ -F "storage_duration=1d"
✅ Allowed File Types
- Images:
.jpg
,.jpeg
,.png
,.gif
,.webp
- Videos:
.mp4
,.webm
Max file size: 99MB per upload.
🔁 What Happens Internally
- A unique hash ID is calculated.
- The file is uploaded to MinIO storage.
- A database entry is created with metadata.
- A thumbnail is queued for generation (if applicable).
- A secret deletion token is generated and linked to a secure deletion URL.
📤 JSON Response
{ "id": "cmcia198c0002oh01k5d7at1y", "file": "https://api.selfgonefile.com/api/v/cmcia198c0002oh0y.gif", "thumbnail": "https://api.selfgonefile.com/api/v/cmcia198c0002oh0y/thumb", "delete": "https://api.selfgonefile.com/api/v/cmcia198c0002oh0y/delete?token=..." }
🛡️ Validation and Limits
- Max size: 99MB
- Rate limit: 30 uploads per minute per IP
- Duplicates: Duplicate hashes will not be re-uploaded
- Invalid types: Non-supported files will be rejected with
415
⌛ Storage Duration Options
Value | Expires After |
---|---|
1d | 1 day |
7d | 7 days |
1m | 1 month |
12m | 12 months |
⚠️ Error Responses
400
: Missing required fields413
: File exceeds maximum size415
: Unsupported file type429
: Too many requests (rate limited)500
: Internal server error
📬 Contact
Email: [email protected]
Report abuse: [email protected]
API maintained for public convenience. Please be respectful with your usage. ❤️