fileWrite

Writes the data to the file object or file path specified using the charset specified or the java default character set if unspecified.

fileWrite(filePath, data [, charset]) → returns void

Argument Reference

filePath any
Required

A file object or a file system path string.

data any
Required

The variable to write to the file.

charset string

An optional character set that the data is encoded with. Defaults to the Java default character set (which is usually UTF-8).

Examples
Sample code invoking the fileWrite function

fileWrite( getTempFile( getTempDirectory(), "tempFile"), "My Data" );

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub