# uploadFile

> Mutation in domain **Assets**

- HTML: [uploadFile.html](uploadFile.html)
- Raw SDL: [uploadFile.sdl](uploadFile.sdl)
- Covered by: [llms.txt](../llms.txt)

Upload a new file. Requires `basic:write` scope to be accessible
Creates a temporary unique file Id and returns presigned URLs for uploading a binary file in multiple parts.
After the upload is completed, this Id can be used (**once only**) to permanently link the file to a specific type (e.g., Asset, Attachment, Revision) via another mutation.

When `chunkSize` is provided as `null` (to be the future default), the number of upload parts and thus their corresponding part size will be computed dynamically based on the specified file size, following these rules:
- Maxmum of 1000 parts.
- For files of 5TB (maximum): 1000 parts of 5GB each.
- For files less than 15MB: 1 single part of 15MB.
- Otherwise: an inclusive range of [1, 1000] parts of [15MB, 5GB] each.

## Returns

`UploadFile`

## Arguments

- `input`: `UploadFileInput!` — `UploadFile` input argument.

## Example

```graphql
mutation UploadFile {
  uploadFile(
    input: {
      filename: "…"
      size: 0
    }
  ) {
    __typename
    id
    urls
  }
}
```

Raw: [`uploadFile.example.sdl`](uploadFile.example.sdl)
