Skip to content

AddFile

Copies a repository file into the document.

1
myDocumentFiles.AddFile(id: string):FileInfo

Parameters

string id
    The ID of the file to copy.

Returns

The FileInfo of the copy that belongs to the document.

Remarks

The document must not be read-only.

Examples

Attach an uploaded file to a document

1
2
3
var doc = $Documents.New('Invoice ' + $Xml.Evaluate('InvoiceNumber'));
doc.Files.AddFile($Xml.Evaluate('InvoiceFile'));
doc.Publish('Finance\\Invoices');

See Also