ファイルアップロード
URL アップロード
プラットフォームがリモート URL からファイルを取得しオブジェクトストレージへアップロード
Authorization
BearerAuth
AuthorizationBearer <token>
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
In: header
Request Body
application/json
file_url*string
远程文件 URL,仅支持 http / https
Format
uriupload_path?string
自定义子目录,自动加 temp/ 前缀;禁止 .. 越级
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://loading/api/common/upload/url" \ -H "Content-Type: application/json" \ -d '{ "file_url": "https://example.com/cat.png" }'{
"success": true,
"code": 200,
"msg": "File uploaded successfully",
"data": {
"file_id": "872defd8180ee9c6d32265ef4e8d255b",
"file_name": "1735471744123456789_a8b9cd2e.png",
"original_name": "cat.png",
"file_size": 3242,
"mime_type": "image/png",
"upload_path": "temp/demo/2025/12/29",
"file_url": "https://cdn.your-platform.com/temp/demo/2025/12/29/1735471744123456789_a8b9cd2e.png",
"download_url": "https://cdn.your-platform.com/temp/demo/2025/12/29/1735471744123456789_a8b9cd2e.png",
"upload_time": "2025-12-29T13:09:04.731057",
"expires_at": "2026-01-01T13:09:04.731057"
}
}{
"detail": "Invalid URL"
}{
"detail": "Invalid URL"
}{
"detail": "Invalid URL"
}{
"detail": "Invalid URL"
}{
"detail": "Invalid URL"
}このガイドはいかがですか?
最終更新