# 本地文件上传

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/qw/doApi:
    post:
      summary: 本地文件上传
      deprecated: true
      description: >-
        <div style="background: linear-gradient(135deg, rgba(255, 213, 145,
        0.45) 0%, rgba(255, 255, 255, 0.06) 100%); border: 1px solid rgba(255,
        236, 202, 0.7); border-radius: 12px; padding: 20px 28px; margin-bottom:
        20px; box-shadow: 0 4px 12px rgba(250, 140, 22, 0.08);">
          <h3 style="margin: 0 0 8px 0; font-size: 18px; font-weight: 600; color: inherit; border: none; padding-bottom: 0;">本地文件上传</h3>
          <p style="margin: 0; font-size: 14px; color: inherit; line-height: 1.6;">提示： 上传文件超过2M，建议试用异步上传 :::</p>
        </div>
      tags:
        - API参考/媒体与运营/文件与媒体（下载/上传）
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: X-QIWEI-TOKEN
          in: header
          description: >-
            <p style="margin: 0; font-size: 14px; color: inherit; line-height:
            1.6;">进入 <a href="https://new.qiweapi.com/tokens" style="color:
            inherit; text-decoration: underline; font-weight: 600;">应用凭证</a>，复制
            <code style="color: inherit; background: rgba(82, 196, 26, 0.08);
            border: 1px solid rgba(82, 196, 26, 0.1); padding: 2px 4px;
            border-radius: 3px;">TokenId</code>。</p>
          required: true
          example: '{{tokenId}}'
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                method:
                  example: /cloud/cdnBigUpload
                  type: string
                guid:
                  description: >-
                    <p style="margin: 0; font-size: 14px; color: inherit;
                    line-height: 1.6;">实例id</p>
                  example: '{{guid}}'
                  type: string
                file:
                  description: >-
                    <p style="margin: 0; font-size: 14px; color: inherit;
                    line-height: 1.6;">文件</p>
                  example: ''
                  type: string
                  format: binary
                fileType:
                  description: >-
                    <p style="margin: 0; font-size: 14px; color: inherit;
                    line-height: 1.6;">1: jpg图片<br>4: mp4视频<br>5:
                    文件(也包括语音amr文件)</p>
                  example: 1
                  type: integer
              required:
                - method
                - guid
                - file
                - fileType
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    title: 状态码
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">状态码，<code style="color: inherit;
                      background: rgba(82, 196, 26, 0.08); border: 1px solid
                      rgba(82, 196, 26, 0.1); padding: 2px 4px; border-radius:
                      3px;">0</code> 成功。</p>
                  data:
                    type: object
                    properties:
                      fileAesKey:
                        type: string
                        title: 文件密钥
                        description: ''
                      fileId:
                        type: string
                        title: 文件 ID
                        description: ''
                      fileKey:
                        type: string
                        title: 文件Key
                        description: ''
                      fileMd5:
                        type: string
                        title: 文件md5值
                        description: ''
                      fileSize:
                        type: integer
                        title: 文件大小
                        description: ''
                      fileThumbSize:
                        type: integer
                        title: 文件缩略图尺寸
                        description: ''
                      filename:
                        type: string
                        title: 文件名称
                        description: ''
                      cloudUrl:
                        type: string
                        title: 文件地址
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">云端文件地址。</p>
                    required:
                      - fileAesKey
                      - fileId
                      - fileKey
                      - fileMd5
                      - fileSize
                      - fileThumbSize
                      - filename
                      - cloudUrl
                    x-apifox-orders:
                      - fileAesKey
                      - fileId
                      - fileKey
                      - fileMd5
                      - fileSize
                      - fileThumbSize
                      - filename
                      - cloudUrl
                    title: 响应数据
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">业务数据。</p>
                  msg:
                    type: string
                    title: 说明
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">返回说明。</p>
                required:
                  - code
                  - data
                  - msg
                x-apifox-orders:
                  - code
                  - data
                  - msg
              example:
                code: 0
                data:
                  cloudUrl: >-
                    http://oos-sccd.ctyunapi.cn/wxapii/qiwe/40ac013b98daa1f5fce0a88949451514.jpg?AWSAccessKeyId=9e882e7187c38b431303&Expires=1789698100&Signature=UBlSC2ZxH81fz7CVrE%2F4bTD
                  durationTime: 0
                  fileAesKey: 63eb53256ba3d2dd5a201dd28bfa35
                  fileId: >-
                    306902010204623060020100020497e8a2c1020c6a81020470cbee7302046aa365b4042438623039653262332d303131632d343136632d613333642d6137613232663635613061390201000203079170041076be7a05d135613a0e45afd97959fdc00201020201000400
                  fileKey: ''
                  fileMd5: 76be7a05d135613a0e4fd97959fdc0
                  fileSize: 495978
                  fileThumbSize: 6868
                  filename: 91e6592402ed4e073b5b777a6295.jpg
                  height: 2400
                  width: 1080
                msg: 成功
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: API参考/媒体与运营/文件与媒体（下载/上传）
      x-apifox-status: deprecated
      x-run-in-apifox: https://app.apifox.com/web/project/7051713/apis/api-344613929-run
components:
  schemas: {}
  securitySchemes:
    apiKey:
      type: apikey
      in: header
      name: X-WECOM-TOKEN
servers:
  - url: https://new.qiweapi.com/qiwe
    description: 正式环境
security: []

```
