Skip to main content

Files

Sonar has a simple but powerful file store built-in. It is accessible on the collection.files property.

The API docs can be found here.

Uploading a file or blob​

const file = await collection.files.createFile(bufferOrStream)

Reading files​

const readableStream = await collection.files.readFile(fileID)

Getting a HTTP URL for a file​

const url = collection.files.getURL(fileID)