Upload file

POST /files

上传文件,用于生成题目。单个文件大小不超过 20 MB。

multipart/form-data

Body Required

Responses

  • 201 application/json

    file created

    Hide response attributes Show response attributes object
  • 400 application/json

    file not uploaded

POST /files
curl \
 -X POST https://v5.jinshuju.net/exam/api/files \
 -H "Content-Type: multipart/form-data" \
 -F "file=@file"
Response examples (201)
{
  "id": "file-6757a41ee88e5d8d2a0bbbc1",
  "bytes": 0,
  "object": "file",
  "filename": "____________.pdf",
  "created_at": "2024-12-10T10:14:54.582+08:00"
}
Response examples (400)
{
  "error": {
    "type": "invalid_request_error",
    "message": "No file uploaded"
  }
}