---
title: "Check upload method"
method: POST
path: "/api/models/{namespace}/{repo}/preupload/{rev}"
tags: ["models"]
---

# Check upload method

`POST /api/models/{namespace}/{repo}/preupload/{rev}`

Check if a file should be uploaded through the Large File mechanism or directly.

## Path parameters

- `namespace` string, required
- `repo` string, required
- `rev` string, required

## Request body

- object
  - `files` object[], required
    - `path` string, required
    - `size` number, required
    - `sample` string, required
  - `gitAttributes` string — Provide this parameter if you plan to modify `.gitattributes` yourself at the same time as uploading LFS files. Note that this is not needed if you solely rely on automatic LFS detection from HF: the commit endpoint will automatically edit the `.gitattributes` file to track the files passed to its `lfsFiles` param.
  - `gitIgnore` string — Content of the .gitignore file for the revision. Optional, otherwise takes the existing content of `.gitignore` for the revision.

## Response `200`

Files to be uploaded.

- object
  - `files` object[], required
    - `path` string, required
    - `uploadMode` 'lfs' | 'regular', required
    - `shouldIgnore` boolean, required
    - `oid` string — The oid of the blob if it already exists in the repository. If the blob is a LFS file, it'll be the lfs oid.
  - `commitOid` string, required

## Other responses

- `422` — The request is invalid

---

[API](https://skmtc.net/huggingface/apis/hub-api-endpoints.md) · [All operations](https://skmtc.net/huggingface/apis/hub-api-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/huggingface/hub-api-endpoints/versions/6ab9f7d9cfb5/schema)
