# Download API

## Download Single File

<mark style="color:blue;">`GET`</mark> `http(s)://[server-host]:[server-port]/server/storage/download/single/:type[dir,file]/:user/:root`

&#x20;단일 파일 다운로드\
디렉토리일 경우 압축을 한 다음 zip파일 형태로 다운받는다.

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| type | string | file or dir |
| user | string | target user |
| root | string | target root |

#### Headers

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| Set-Cookie | string | token       |

{% tabs %}
{% tab title="200 return file information (+ raw data)" %}

```
{File information}
```

{% endtab %}
{% endtabs %}

## Download Multiple File

<mark style="color:blue;">`GET`</mark> `http(s)://[server-host]:[server-port]/server/storage/download/multiple/:user/:parentRoot:Files`

&#x20;다중 파일 다운로드

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| user | string | target user |

#### Query Parameters

| Name       | Type   | Description                 |
| ---------- | ------ | --------------------------- |
| parentRoot | object | list of file/directory root |

#### Headers

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| Set-Cookie | string | token       |

{% tabs %}
{% tab title="200 return zip file" %}

```
{Zip file}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
parentRoot는 쿼리 파라미터입니다. 그런데 다중 파일을 받게 되므로 해당 key format은 다음과 같습니다.&#x20;

file-1, file-2, dir-1, dir-2 ..
{% endhint %}
