# Upload File to Project

The endpoint allows users to upload files to a specific project. The request must include a list of files, and the user must have appropriate permissions to access the project.

***

### Endpoint Information

* **URL**: `<custom-env-url>/Testinium.RestApi/api/file/project/{projectId}`
* **Method**: `POST`
* **Authentication**: `Bearer Token` is required
* **Content-Type**: `multipart/form-data`

***

### Path Variables

| Parameter   | Type   | Required | Description                                            |
| ----------- | ------ | -------- | ------------------------------------------------------ |
| `projectId` | `Long` | Yes      | The ID of the project where the file will be uploaded. |

***

### Request Body

The request body must include one or more files to upload. The files should be sent as a multipart form-data request.

| Parameter | Type                  | Required | Description                |
| --------- | --------------------- | -------- | -------------------------- |
| `files`   | `List<MultipartFile>` | Yes      | A list of files to upload. |

***

### Response Body

Upon a successful request, the API returns an HTTP status of 200 OK.

| Field    | Type     | Description                            |
| -------- | -------- | -------------------------------------- |
| `status` | `string` | The status of the file upload request. |

***

### Error Codes

| HTTP Code | Error Message           | Description                                                       |
| --------- | ----------------------- | ----------------------------------------------------------------- |
| `400`     | `Invalid file`          | The file is empty or invalid.                                     |
| `401`     | `Unauthorized`          | Authorization failed. The user is not logged in.                  |
| `403`     | `Forbidden`             | The user does not have permission to upload files to the project. |
| `404`     | `Project not found`     | The specified project was not found.                              |
| `500`     | `Internal Server Error` | An unexpected error occurred on the server side.                  |

***

### Example Request

```bash
curl --location '<custom-env-url>/Testinium.RestApi/api/file/project/{projectId}' \
--header 'Authorization: Bearer <your_access_token>' \
--form 'files=@path_to_file1'

```


---

# 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://testinium.gitbook.io/testinium-enterprise/apis/enterprise-2.0/project/upload-file-to-project.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.
