Skip to main content

exportFilename

@forge/monorepo


@forge/monorepo / backend/src / exportFilename

Function: exportFilename()

exportFilename(name, format): string

Defined in: backend/src/export/index.ts:428

A safe download filename.

Derived from the artifact's name, which is user input, so it is reduced to a conservative character class rather than trusted: a filename is a Content-Disposition header value, and a header value containing a newline is a response-splitting bug rather than a badly-named file.

Parameters

name

string

format

"pdf" | "markdown"

Returns

string