# Uploading a File

## Upload a File

<mark style="color:green;">`POST`</mark> `https://fileio.couchdrop.io/file/upload`

This endpoint allows you to upload files

#### Query Parameters

| Name    | Type   | Description                                                                                     |
| ------- | ------ | ----------------------------------------------------------------------------------------------- |
| path    | string | Path to upload destination                                                                      |
| size    | number | File size                                                                                       |
| modtime | number | Last modified time. (Not all storage providers support the specification of modtimes on upload) |

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

#### Request Body

| Name | Type   | Description           |
| ---- | ------ | --------------------- |
| data | object | File object to upload |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{}
```

{% endtab %}

{% tab title="403 Permission denied" %}

```
{"error": "you cannot write to that folder"}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.couchdrop.io/filesystem-operations/uploading-a-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
