function createFileDump
createFileDump(
file: File,
comment: string | undefined,
userId: string,
isPrivate?: boolean,
title?: string,
categoryIds?: string[]
): Promise<Dump>

Posts an uploaded file as userId, for POST /api/dumps, and stores it in DUMPS_DIR under the dump's id. It is announced and notified as createUrlDump does.

Parameters

file: File
comment: string | undefined
userId: string
optional
isPrivate: boolean = false
optional
title: string
optional
categoryIds: string[]

Return Type

Promise<Dump>

Throws

APIException

400 when the title or comment is too long, the file's type isn't allowed, it exceeds 50 MB, or a category doesn't exist.

Usage

import { createFileDump } from "api/services/dump-service.ts";