Upload folder

Syntax

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

NameTypeRequiredDescription

Input

Array Buffer

Yes

Buffer file data

opts

Object

Yes

Initialization parameter

metadata

Object

Yes

Info a file and project

Properties

opts

NameTypeRequiredDescription

projectKey

String

Yes

project key to authenticate client and eueno server

key

Object

No

The keys in encrypting the file if the storage method is encryption.

key

NameTypeRequiredDescription

walletPublicKey

String

Yes

public key of the user used to encrypt the file encryption key fileEncryptionKey

fileEncryptionKey

String

No

Symmetric key used to encrypt files

metadata: Information of the file and the project eueno

NameTypeRequiredDescription

projectId

Int

Yes

Id project eueno

pathLists

Array

Yes

List metadta

pathLists: List of files in a folder

NameTypeRequiredDescription

path

String

No

path storage on eueno, default root

filename

String

Yes

Name of file

contentLength

Int

Yes

Size of file

contentType

String

Yes

Type of file eg: image/png

method

String

Yes

Encrypted or Unencrypted Storage Method ENCRYPT or UNCRYPTED

keepPath

Bool

No

To avoid duplicate names on eueno's mfs system, we will add a datetime field to the name of the file.

Last updated