{% extends 'core/base.html' %} {% block content %}
{{ content.content|truncatechars:200 }}
{% endif %} {% if content.file %} 下载文件 {% endif %} {% if content.is_temp_file and content.expire_at %} {% load humanize %} {{ content.expire_at|naturaltime }}过期 {% endif %}端点: POST /api/v1/temp-upload/
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| title | string | 是 | 文件标题 |
| file | file | 是 | 文件 (最大500MB) |
| expire_type | string | 是 | 过期时间: expire_1h (1小时) / expire_1d (1天) / expire_7d (7天) |
{
"success": true,
"message": "上传成功",
"id": 1,
"file_url": "/media/public_files/xxx.pdf",
"file_name": "document.pdf",
"file_size": 1048576,
"expire_at": "2026-05-25T18:30:00Z",
"expire_type": "expire_1d"
}
curl -X POST -F "file=@document.pdf" -F "title=测试文件" -F "expire_type=expire_1d" http://localhost:8000/api/v1/temp-upload/