# 文件资源上传

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/resource/upload:
    post:
      summary: 文件资源上传
      deprecated: false
      description: |+

        :::caution
        该协议使用  `multipart/form-data` 上传文件, 不是通常的 `json` 方式

        :::
        :::caution
        文件大小限制: 最大20MB
        :::


        :::caution
        资源保留时间: 24小时
        :::


      tags:
        - 文件相关
      parameters: []
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  description: ' ,上传文件'
                  type: string
                  format: binary
                  example: ''
              required:
                - file
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                title: ResponseModel
                properties:
                  code:
                    type: integer
                    description: 错误码( 0:成功. 其它值:失败[无data数据区])
                  info:
                    type: string
                    description: 错误信息
                    examples:
                      - succ
                  request_id:
                    type: string
                    description: 请求id,用于定位请求
                    examples:
                      - 21al1389334aal4f
                  data:
                    type: object
                    properties:
                      resource_id:
                        description: 资源id
                        type: string
                    required:
                      - resource_id
                    description: 数据区
                    x-apifox-orders:
                      - resource_id
                required:
                  - code
                  - info
                  - request_id
                x-apifox-orders:
                  - code
                  - info
                  - request_id
                  - data
          headers: {}
          x-apifox-name: 成功
      security:
        - bearer: []
      x-apifox-folder: 文件相关
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/3930068/apis/api-147355725-run
components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.mindshow.vip
    description: 正式环境
security:
  - bearer: []

```
