Eueno
  • EUENO – Decentralized Encrypting Blockchain Oracles for Web3
    • Litepaper
    • Use Cases
  • Get Started
    • Prerequisites
    • Buckets
      • Create a bucket
      • Delete a bucket
    • Files
      • Upload a file
      • View a file
      • Delete a file
      • Share a file
  • Pricing
  • Eueno libraries
    • @eueno/lib-browser
      • Installation
      • Setup
      • Create key (generate a key for encrypting the file(s))
      • login()
      • useEuenoContext()
      • getUserInfo()
      • updateUserInfo()
      • createProject()
      • getProjectInfo()
      • getProjects()
      • getFilesListByFolder()
      • deleteProject()
      • createFolder()
      • uploadFolder()
      • Get folder detail
      • deleteFolder()
      • uploadFile()
      • uploadFileWithSignedUrl()
      • getCid()
      • getFileById()
      • getFileListById()
      • Get file detail
        • getDetailFile()
        • getDetailUnencryptedFile()
        • getDetailEncryptedFile()
      • getDetailMultiEncryptedFiles()
      • deleteFile()
      • shareFile()
      • shareMultiFile()
      • deleteSharePermission()
      • getShareList()
      • getShareListToMe ()
    • @eueno/lib-node
      • Create eueno client
      • Create project key
      • Create project
      • Upload file
      • Upload folder
      • Get file
      • Get list file
      • Share file
      • Get shared files
      • Create folder
      • Create Account
      • Decrypt Get Key Aes
      • Decrypt File by Key Aes
  • Policies
    • Privacy Policy
    • Terms of Service
Powered by GitBook
On this page
  • Syntax
  • Parameters
  • Example
  1. Eueno libraries
  2. @eueno/lib-browser

getFileById()

Syntax

getFileById(id: string | number, token?: string)

The method gets file information by file ID.

Parameters

Name
Type
Required
Description

id

string or number

Yes

The file id.

token

string

No

The authentication token response from Eueno API when login. After login, this token was saved in local storage with the name “eueno-token".

Example

import { getFileById } from "@eueno/lib-browser";

const getDetailFile = async (id, token) => {
 try {
   const response = await getFileById(id);
   console.log(response?.data?.data);
 } catch (error) {
   console.log(error);
 }
};

Response of example:

"data": {
        "id": "216756",
        "name": "2월 하트 월페이퍼_워치_2.jpg",
        "nameNo": 1,
        "url": "https://node1…",
        "backupUrl": "https://node1…",
        "size": "188679",
        "mimeType": "image/jpeg",
        "method": "ENCRYPT",
        "torrentSize": 4,
        "torrentUrl": "https://node1…",
        "backupTorrentUrl": "https://node1…",
        "encryptKey": "71367d669…3a4821",
        "createdAt": "2023-02-28T04:48:54.251Z",
        "updatedAt": "2023-02-28T04:48:57.020Z"
    }
PreviousgetCid()NextgetFileListById()

Last updated 2 years ago