getFileById()
getFileById(
fileId:string):Promise<FileInfo>
Defined in: packages/core/src/index.ts:1650
Get file information by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
fileId | string | The unique identifier of the file |
Returns
Promise<FileInfo>
File information including name, size, type, and metadata
Throws
401 - Not authenticated
Throws
404 - File not found
Example
import { getFileById } from "@cpod/sdk";
const file = await getFileById("file-123");
console.log(`${file.name} (${file.size} bytes)`);