function replaceUploadedFile
replaceUploadedFile(
filePath: string,
): Promise<void>

Writes data to filePath, replacing whatever is there only once the whole file is written, so a failed write leaves the old file whole. The upload routes call it before recording the new file, so that clients told of it never fetch it early.

Parameters

filePath: string

Return Type

Promise<void>

Usage

import { replaceUploadedFile } from "api/lib/upload.ts";