Upload a File

Upload one or more new Files to Catalytic.

Method Signature

upload(filePath: string): Promise<FileMetadata>;
upload(filePath: string, callback: (err?: Error, fileMetadata: FileMetadata) => any): void;


filePathstringThe path to the file to upload
returnsFileThe metadata for the uploaded file


 * This example demonstrates uploading a File to Cataltyic
const { CatalyticClient } = require('@catalytic/sdk');

const catalytic = new CatalyticClient();

const filePath = '/path/to/file/to/upload';
const fileMetadata = await catalytic.files.upload(filePath);

console.log(`Uploaded file has ID "${fileMetadata.id}"`);