getFileById()

Syntax

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

The method gets file information by file ID.

Parameters

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"
    }

Last updated