---
title: "Upload and stage a file for an in-progress dataset"
method: PUT
path: "/datasets/{doi}/files/{filename}"
tags: ["files"]
---

# Upload and stage a file for an in-progress dataset

`PUT /datasets/{doi}/files/{filename}`

Allows uploading a file to be staged for submission to the storage repository. The files will be stored in the storage repository after the dataset is submitted.  The body of the request will be the file you are uploading.  Set the `Content-Type` http header to the appropriate mimetype for your file when uploading.

## Path parameters

- `doi` string, required
- `filename` string, required

## Response `201`

File was created on the server.

- object
  - `_links` object
    - `self` HalLink
      - `href` string, uri, required
    - `stash:dataset` HalLink
      - `href` string, uri, required
    - `stash:version` HalLink
      - `href` string, uri, required
    - `stash:files` HalLink
      - `href` string, uri, required
    - `stash:download` HalLink
      - `href` string, uri, required
    - `curies` HalCurie[]
      - `name` string, required
      - `href` string, uri, required
      - `templated` boolean, required
  - `path` string
  - `size` integer
  - `mimeType` string
  - `status` string
  - `digest` string
  - `digestType` string
  - `description` string
  - `url` string

## Other responses

- `401`
- `404`

---

[API](https://skmtc.net/datadryad/apis/dryad-api.md) · [All operations](https://skmtc.net/datadryad/apis/dryad-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadryad/dryad-api/revisions/5e35babfb8d2/schema)
