> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/api/client-libraries/redivis-js/reference/table/table.addfiles.md).

# Table.addFiles

### Table.<mark style="color:purple;">addFiles</mark>(*{ files, directory, maxParallelization, onProgress, signal }*) → `Promise<void>`

Uploads non-tabular files to a [file index table](https://docs.redivis.com/reference/datasets/files) (created with `isFileIndex: true`) in an unreleased version of a dataset. Files are uploaded in parallel, in batches, and large files are uploaded resumably. Exactly one of `files` or `directory` must be provided.

```javascript
// In Node.js, add every file in a directory (named by their path within it)
await table.addFiles({ directory: './images' });

// Add specific files
await table.addFiles({
  files: [
    './path/to/file.png', // A file path (Node.js only)
    { path: './path/to/other.png', name: 'renamed.png' }, // A file path, with a different name
    { name: 'hello_world.txt', data: 'Hello world' }, // string, Blob, ArrayBuffer, or typed array data
    fileInput.files[0], // A File, e.g., from an <input type="file">
  ],
});

// In the browser, add every file in a directory picked by the user, keeping its structure
// (with <input type="file" webkitdirectory>)
await table.addFiles({ files: directoryInput.files });
```

**Parameters:**

**`files`** : *Array | FileList, optional*\
The files to add. Each may be a file path (Node.js only); a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File), which is named by its path within a picked directory, if any; `{ path, name? }`; or `{ name, data }`, where `data` is a string (uploaded as UTF-8 text), `Blob`, `ArrayBuffer`, or typed array.

**`directory`** : *string, optional*\
A local directory whose files are all added, named by their path within it (Node.js only). Hidden files are skipped.

**`maxParallelization`** : *number, optional*\
The number of files to upload at once.

**`onProgress`** : *function, optional*\
Called with `{ bytesUploaded, totalBytes, filesUploaded, totalFiles }` as the upload progresses.

**`signal`** : *AbortSignal, optional*

**Returns:** `Promise<void>`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.redivis.com/api/client-libraries/redivis-js/reference/table/table.addfiles.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
