> ## Documentation Index
> Fetch the complete documentation index at: https://docs.askui.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload File

> Upload a file (max. 5 GB) to the specified path.

- Specify the `Content-Type` header for accurate file type handling.
- If `Content-Type` is omitted, the system will attempt to infer it.
- For workspace-specific uploads, use path: `workspaces/{workspace_id}/...`
- If a file with the same file path already exists, it will be overwritten.
- If there are unsupported characters in the file path, they will be removed or replaced.
- If the file path is longer than `1024` characters, the file path will be shortened starting from the end.
- Set `strict=true` to fail the request if the file path would be modified during sanitization (e.g., if the file path contains unsupported characters or is too long).



## OpenAPI

````yaml put /api/v1/files/{file_path}
openapi: 3.1.0
info:
  title: AskUI Workspaces API
  version: 0.2.15
servers: []
security: []
paths:
  /api/v1/files/{file_path}:
    put:
      tags:
        - files
      summary: Upload File
      description: >-
        Upload a file (max. 5 GB) to the specified path.


        - Specify the `Content-Type` header for accurate file type handling.

        - If `Content-Type` is omitted, the system will attempt to infer it.

        - For workspace-specific uploads, use path:
        `workspaces/{workspace_id}/...`

        - If a file with the same file path already exists, it will be
        overwritten.

        - If there are unsupported characters in the file path, they will be
        removed or replaced.

        - If the file path is longer than `1024` characters, the file path will
        be shortened starting from the end.

        - Set `strict=true` to fail the request if the file path would be
        modified during sanitization (e.g., if the file path contains
        unsupported characters or is too long).
      operationId: upload_file_api_v1_files__file_path__put
      parameters:
        - name: file_path
          in: path
          required: true
          schema:
            type: string
            title: File Path
        - name: strict
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Strict
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_file_api_v1_files__file_path__put
      responses:
        '201':
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFileResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
        '413':
          description: File too large (max. 5 GB)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
        '422':
          description: File path contains invalid characters or exceeds maximum length
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
      security:
        - Bearer: []
        - Basic: []
components:
  schemas:
    Body_upload_file_api_v1_files__file_path__put:
      properties:
        file:
          type: string
          format: binary
          title: File
      type: object
      required:
        - file
      title: Body_upload_file_api_v1_files__file_path__put
    UploadFileResponse:
      properties:
        filePath:
          type: string
          title: Filepath
        contentType:
          type: string
          title: Contenttype
      type: object
      required:
        - filePath
        - contentType
      title: UploadFileResponse
    StringErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: StringErrorResponse
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
    Basic:
      type: apiKey
      in: header
      name: Authorization

````