Skip to content

Vault.getAvailablePathForAttachments method

Vault › getAvailablePathForAttachments

Unofficial

Get path for attachment that does not conflict with other existing files

Signature:

getAvailablePathForAttachments(filename: string, extension: string, file: TFile | null): Promise<string>

Parameters:

ParameterTypeDescription
filenamestringThe desired filename.
extensionstringThe file extension.
fileTFile | nullThe file associated with the attachment, or null.

Returns: Promise<string>An available path for the attachment.