User Tools

Site Tools


Sidebar

file:readfile

.readFile()

Method to read the contents of a file. The method returns the content of the file. Line feeds are preserved. You can also use the method .content().

Note: This method is different from the default ExtendScript method read().

Usage

var file = new File("C:/myfile.txt");
var filecontents = file.readFile();

Parameters

Parameter Data type Required Description
encoding string The file encoding used for reading the file. Default encoding is UTF-8

Return Values

Value Meaning
null The file does not exist
string The contents of the file
file/readfile.txt · Last modified: 2017/05/20 14:39 (external edit)