Open topic with navigation

# Create a Document

With ConnectorLib .NET, you can create a new document using the `DocInfo.Create()` methods, for example:

           IDocInfo doc = DocInfo.Create(task.TaskConfig,
    		"http://www.example.com/testDocument.doc",
    		"testDocument.doc", true);

The arguments for this method are:

           Create(ITaskConfig taskConfig, String reference,
    		String fileName, bool ownFile)

The reference uniquely identifies the document and is used for the `DREREFERENCE` if the document is ingested. The file `testDocument.doc` forms the content of the document. If the document is sent to CFS, KeyView extracts metadata and content from the file and adds this information to the document. The final argument indicates whether `testDocument.doc` is a temporary file owned by the connector. In the example, this argument is passed the value `true`, which means that ConnectorLib .NET automatically deletes the file when it is no longer needed.

The `IDocInfo` object is disposable. If you create a document using `DocInfo.Create()` you should also dispose of it, either by calling `Dispose()` or by wrapping it in a `using` block.

© 2018 Micro Focus or one of its affiliates | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm