# Upload folder

#### Syntax

#### &#x20;                                               eueno.uploadFolder(input,`[opts],metadata`)

#### Example

```
const Eueno = require('@eueno/lib-node');

async function example() {
  const eueno = new Eueno({
    endpoint: 'https://v2-developers.eueno.io',
  });
  let data = await eueno.readFolder('./lib');

  await eueno.uploadFolder(data.input, {
      projectKey: 'project_key',
      key: {
        walletPublicKey: 'public_key_of_user_if_method_encrypt',
        fileEncryptionKey: 'key_encrypt_file'
      },
  }, {
    pathLists: data.pathLists,
    projectId: "project id",
  });
}

example();

```

## Parameters

<table><thead><tr><th width="135">Name</th><th width="134">Type</th><th width="119">Required</th><th>Description</th></tr></thead><tbody><tr><td>Input</td><td>Array Buffer</td><td>Yes</td><td>Buffer file data</td></tr><tr><td>opts</td><td>Object</td><td>Yes</td><td>Initialization parameter</td></tr><tr><td>metadata</td><td>Object</td><td>Yes</td><td>Info a file and project</td></tr></tbody></table>

## Properties <a href="#properties" id="properties"></a>

**opts**

<table><thead><tr><th width="135">Name</th><th width="107">Type</th><th width="119">Required</th><th>Description</th></tr></thead><tbody><tr><td>projectKey</td><td>String</td><td>Yes</td><td>project key to authenticate client and eueno server</td></tr><tr><td>key</td><td>Object</td><td>No</td><td>The keys in encrypting the file if the storage method is encryption.</td></tr></tbody></table>

**key**

<table><thead><tr><th width="202">Name</th><th width="107">Type</th><th width="119">Required</th><th>Description</th></tr></thead><tbody><tr><td>walletPublicKey</td><td>String</td><td>Yes</td><td>public key of the user used to encrypt the file encryption key <code>fileEncryptionKey</code></td></tr><tr><td>fileEncryptionKey</td><td>String</td><td>No</td><td>Symmetric key used to encrypt files</td></tr></tbody></table>

**metadata**: Information of the file and the project eueno&#x20;

<table><thead><tr><th width="170">Name</th><th width="107">Type</th><th width="119">Required</th><th>Description</th></tr></thead><tbody><tr><td>projectId</td><td>Int</td><td>Yes</td><td>Id project eueno</td></tr><tr><td>pathLists</td><td>Array</td><td>Yes</td><td>List metadta</td></tr></tbody></table>

**pathLists**:  List of files in a folder

<table><thead><tr><th width="170">Name</th><th width="107">Type</th><th width="119">Required</th><th>Description</th></tr></thead><tbody><tr><td>path</td><td>String</td><td>No</td><td>path storage on eueno, default root</td></tr><tr><td>filename</td><td>String</td><td>Yes</td><td>Name of file</td></tr><tr><td>contentLength</td><td>Int</td><td>Yes</td><td>Size of file</td></tr><tr><td>contentType</td><td>String</td><td>Yes</td><td>Type of file eg: image/png</td></tr><tr><td>method</td><td>String</td><td>Yes</td><td>Encrypted or Unencrypted Storage Method <code>ENCRYPT</code> or <code>UNCRYPTED</code></td></tr><tr><td>keepPath</td><td>Bool</td><td>No</td><td>To avoid duplicate names on eueno's mfs system, we will add a datetime field to the name of the file.</td></tr></tbody></table>
