PluginFile
A file the user chose in a file dialog. The plugin may read it, and write it when the user chose it in a save dialog; it reaches no other file. Reads and writes are whole files, of at most 256 MB.
Properties
Section titled “Properties”
readonlyname:string
The file’s name, without its folder.
Methods
Section titled “Methods”readBytes()
Section titled “readBytes()”readBytes():
Uint8Array
Returns
Section titled “Returns”Uint8Array
readText()
Section titled “readText()”readText():
string
Reads the file as UTF-8 text.
Returns
Section titled “Returns”string
writeBytes()
Section titled “writeBytes()”writeBytes(
bytes):void
Parameters
Section titled “Parameters”ArrayBuffer | Uint8Array<ArrayBufferLike>
Returns
Section titled “Returns”void
writeText()
Section titled “writeText()”writeText(
text):void
Replaces the file’s content; only for files chosen to save.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void