# EmbeddedFileCollection Object

> Represents a collection of embedded files. To access the embedded files of a document use DocumentSettings.embeddedFiles.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 29.0
- **Path:** DS Server > Reference > JavaScript API > EmbeddedFileCollection Object
- **580 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/embeddedfilecollection/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/embeddedfilecollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/embeddedfilecollection/llms-full.txt

---

### Description

Represents a collection of embedded files. To access the embedded files of a document use [DocumentSettings.embeddedFiles](https://docs.textcontrol.com/ds-server/reference/javascript/documentsettings/embeddedfiles-property/llms-full.txt).

### Syntax

```javascript
EmbeddedFileCollection
```

### Examples

The following example demonstrates `EmbeddedFileCollection` in a practical document-editing workflow. It represents a collection of embedded files. To access the embedded files of a document use DocumentSettings.embeddedFiles.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.textParts.getMainText(function(mainText) {
    const embeddedFiles = mainText.embeddedFiles;
    console.log("EmbeddedFileCollection object:", embeddedFiles);
}, onTxError);
```

---

## In This Section

- [Javascript: EmbeddedFileCollection.addBinaryFile Method](https://docs.textcontrol.com/ds-server/reference/javascript/embeddedfilecollection/addbinaryfile-method/llms-full.txt): Adds an embedded binary file to the collection.
- [Javascript: EmbeddedFileCollection.addTextFile Method](https://docs.textcontrol.com/ds-server/reference/javascript/embeddedfilecollection/addtextfile-method/llms-full.txt): Adds an embedded text file to the collection.
- [Javascript: EmbeddedFileCollection.removeElementAt Method](https://docs.textcontrol.com/ds-server/reference/javascript/embeddedfilecollection/removeelementat-method/llms-full.txt): Removes the embedded file at the given index.

---

## Nearby

- **Previous:** [Javascript: EmbeddedFile.setRelationship Method](https://docs.textcontrol.com/ds-server/reference/javascript/embeddedfile/setrelationship-method/llms-full.txt)
- **Next:** [Javascript: EmbeddedFileCollection.addBinaryFile Method](https://docs.textcontrol.com/ds-server/reference/javascript/embeddedfilecollection/addbinaryfile-method/llms-full.txt)
