Delete File
Delete a file by its full object path in the bucket using client.storage.deleteFile().
Function Signature
client.storage.deleteFile(params: DeleteFileParams): Promise<{ message: unknown } | BolticErrorResponse>
Parameters
DeleteFileParams
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | ✅ | Full object path (same as list fullPath / upload path) |
storageType | string | ❌ | Optional storage type |
filepath | string | ❌ | Optional path (advanced) |
totalsize | number | ❌ | Optional size hint (advanced) |
Example
import { createClient, isErrorResponse } from "@boltic/sdk";
const client = createClient("your-api-key");
const result = await client.storage.deleteFile({
filename: "my-app/uploads/report.txt",
});
if (isErrorResponse(result)) {
console.error(result.error.message);
} else {
console.log("Deleted:", result.message);
}