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
| Name | Optionality | Type | Description |
|---|---|---|---|
| selectedFileID | Required | number | Selected file's ID. |
| selectedObject | Required | ISelectedFile | Selected object info. |
| fileToBeReplaced | Required | null | FileList | File to replace (ignored if dataURL provided). See FileList from MDN |
| dataURL | Optional | null | string | Optional data URL (base64 + mime); overrides fileToBeReplaced. |
| dataURLName | Optional | null | string | Filename to use when dataURL is supplied (required with dataURL). |
Return type
| Type | Description |
|---|---|
| Promise < void > | Method does not return a value |