Skip to main content

ReplaceFile

Description

Perform file replace.

If a data URL is provided it takes precedence and will be used as the replacement file (overriding fileToBeReplaced). Data URLs must be base64-encoded, include a MIME type and the decoded payload must not exceed 64 MiB (67,108,864 bytes). When using a data URL you must also provide dataURLName (filename for the decoded file).

Syntax

// shellListing points to instance of IShellListing
await shellListing.ReplaceFile(
selectedFileID,
selectedObject,
fileToBeReplaced,
dataURL,
dataURLName,
);

Parameters

NameOptionalityTypeDescription
selectedFileIDRequirednumberSelected file's ID.
selectedObjectRequiredISelectedFileSelected object info.
fileToBeReplacedRequirednull | FileListFile to replace (ignored if dataURL provided). See
FileList from MDN
dataURLOptionalnull | stringOptional data URL (base64 + mime); overrides fileToBeReplaced.
dataURLNameOptionalnull | stringFilename to use when dataURL is supplied (required with dataURL).

Return type

TypeDescription
Promise < void >Method does not return a value