# Files

## description

**Files** is everything related to file upload in Twake after the migration to Node.js. Note that the Twake Drive isn't part of this migration because it will be replaced by Linshare.

Twake Files upload support chunk upload and file encryption.

## Wording

**File:** document to upload, no constraint on the type of document (image, text, pdf ..)

**Chunk:** Large file are split in multiple chunk for the upload process

## Encryption

Files and Storage services in Twake feature encryption at rest in **aes-256-cbc**.

Each file is encrypted with two layers:

* A file encryption key and iv stored in database and different for each file.
* A global encryption key and iv used in addition to the previous one and equal for each file.

## Models and APIs

{% content-ref url="/pages/-M\_uLppeYs73\_vtbywx-" %}
[Database models](/internal-documentation/backend-services/files-service/database-models.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M\_uLppf9JjeUo4WPLht" %}
[REST APIs](/internal-documentation/backend-services/files-service/rest-apis.md)
{% endcontent-ref %}

## Miscellaneous

{% content-ref url="/pages/-M\_uMzPEEZVa033pMptd" %}
[Resumable.js](/internal-documentation/backend-services/files-service/resumablejs.md)
{% endcontent-ref %}


---

# 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://doc.twake.app/internal-documentation/backend-services/files-service.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.
