Table of Contents
Form record File Upload API
Media Upload API
Overview
This API provides endpoints for uploading media files with strict validation for file types and sizes.
Supported File Formats
- Images: .jpeg, .jpg, .gif, .png
- Documents: .pdf
- Videos: .mp4, .mov
File Size Limits
- Maximum size: 10MB per file
- Multiple files: Supported for bulk upload
API Endpoints
1. Upload Multiple Media Files
Domain Example: `https://api.qc.cxgenie.ai/` Method: POST Endpoint: `/api/v2/files/upload/form-builder/multiple`
Request
- Header: `Content-Type: multipart/form-data`
- Body: `files[]` (array of binary files)
Response
{
"success": true,
"data": [
{
"name": "image1.jpg",
"url": "https://storage.example.com/file/image1.jpg",
"type": "image/jpeg",
"size": 1024000
},
{
"name": "document.pdf",
"url": "https://storage.example.com/file/document.pdf",
"type": "application/pdf",
"size": 2048000
}
]
}
Error Handling
File Size Exceeded
{
"success": false,
"message": "File \"large-file.mp4\" exceeds maximum size of 10MB. Current size: 15.50MB"
}
Unsupported File Type
{
"success": false,
"message": "File \"document.doc\" has unsupported type \"application/msword\". Supported types: jpeg, gif, png, pdf, mp4, quicktime"
}
Validation Rules
- File Type Validation: Only allows specified MIME types
- File Size Validation: Maximum 10MB per file
- Multiple File Support: Can upload multiple files in a single request
- Automatic File Processing: Files are automatically uploaded to cloud storage
Usage Examples
Security Features
- File type validation prevents malicious file uploads
- File size limits prevent abuse
- Cloud storage integration for secure file handling
- Automatic file naming and organization
Notes
- Files are stored in the `file/` folder in cloud storage
- Original filenames are preserved in the response
- File URLs are returned for immediate access
- All uploads are logged and tracked

