APIMPAPIMP
用户指南AI 接口图片接口视频接口公共接口
文件上传

URL 抓取上传

由平台从远程 URL 拉取文件并上传到对象存储

POST
/api/common/upload/url

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

In: header

Request Body

application/json

file_url*string

远程文件 URL,仅支持 http / https

Formaturi
upload_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"
}

这篇文档对您有帮助吗?

最后更新于