OpenWGA 7.7 - TMLScript reference

WGA » WGA.File()
Method :

copy(InputStream)
copy(WGDocument | TMLContext, attachmentname)

On object WGA.File()
Usage Copies filedata from an imput steam or content attachment to the file.
Parameters

InputStream

input stream to read bytes from to be written to the file.

OR

WGDocument | TMLContext

The OpenWGA document to read a given attachment from

attachmentname (String)

The name of a content attachment to copy to the file.

Examples
var doc = context("name:home");
WGA.File("export.html").copy(doc, "mail.html");
// exports a content attachment "mail.html" to the file system as file "export.html"