Upload File
| Category | Storage Path | Extensions |
|---|---|---|
| Images | assets/image/ | .jpg, .jpeg, .png, .gif, .webp, .bmp, .svg |
| Videos | assets/video/ | .mp4, .avi, .mov, .wmv, .flv, .webm, .mkv |
| Audio | assets/audio/ | .mp3, .wav, .flac, .aac, .ogg, .m4a |
| Documents | assets/docs/ | .pdf, .doc, .docx, .txt, .ppt, .pptx, .xls, .xlsx, .csv |
Method 1: URL Upload
Download a file from a URL.| Parameter | Type | Description |
|---|---|---|
file_url | string | URL of the file to download |
file_type | string | Type of file (pdf, image, audio, video, auto) |
Method 2: Direct Upload
Upload base64-encoded file data directly.| Parameter | Type | Description |
|---|---|---|
file_data | string | Base64 encoded file data |
file_name | string | Original filename |
file_type | string | Type of file (pdf, image, audio, video, auto) |
Response (both methods)
Size Limits
| Category | Max Size |
|---|---|
| Images | 10 MB |
| Videos | 100 MB |
| Audio | 50 MB |
| Documents | 10 MB |
413.
Upload Methods Comparison
| Method | Best For | Pros | Cons |
|---|---|---|---|
| URL Upload | External files, cloud storage | No file size limits, efficient | Requires accessible URL |
| Direct Upload | Local files, form uploads | Works with any file source | Limited by request size |
Complete Examples
Batch Upload
Error Codes
| HTTP Status | Meaning |
|---|---|
200 | Success |
400 | Bad request (invalid parameters) |
401 | Unauthorized (invalid API secret) |
413 | File too large |
415 | Unsupported file type |
500 | Internal server error |
