<!-- Source: https://docs.squirro.com/en/latest/technical/data-loading/connectors/built-in/documents.html -->
# Documents Connector

Profile: Project Creator

This page provides an overview of the _Documents_ connector.

Project creators use this connector to upload documents to their Squirro projects.

## Overview

The _Documents_ connector is one of the most frequently-used out-of-the-box [Built-In Data Connectors](index.md#data-loading-connectors-built-in).

It is found under the Data Import tab of Data Sources and is used to upload common office document file types to a Squirro project.

[![Documents Connector](https://s3.amazonaws.com/download.squirro.net/docs/technical/data-loading/documents-connector.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/data-loading/documents-connector.png)

Reference: For general information on how to load data into Squirro, see [How to Load Data Using the UI](../../how-to/how-load-ui.md#data-loading-how-ui).

## Acceptable Document Types

The _Documents_ connector allows you to upload the following common document formats, including Microsoft Office and OpenOffice file types:

- .CSV
- .DOC, .DOCX
- .ODP, .ODS, .ODT
- .PDF
- .PPT, .PPTX
- .RTF
- .TXT
- .XLS, .XLSX

> **Warning**
>
> Password protection on files must be removed before upload, otherwise they will not load correctly and will not be indexed.

When uploading documents programmatically using the [DocumentUploader](../../../api/squirro_client/documentuploader.md#documentuploader), provide the `mime_type` argument explicitly. If `mime_type` is omitted, the platform must infer it from the file content or file extension further down the ingestion pipeline, which is less reliable. Setting it explicitly guarantees correct handling, in particular for Microsoft Office formats that require the PDF Conversion step before their text content can be extracted.

### CSV and Excel Files

Squirro offers standalone _CSV_ and _Excel_ connectors for working with CSV, XLS, and XLSX files in a more advanced way.

If these file types are uploaded using the _Documents_ connector, they are converted to PDFs for indexing.

If end users will simply view the files in the Squirro UI, this is fine. However, if you will be using these file types as the basis to create labels, as the basis of machine learning models, or in other advanced use cases, you should use a dedicated connector instead.

> **Note**
>
> When the Excel and CSV connectors are used, every row in those uploaded files is indexed as a separate Squirro item. However, with the _Documents_ connector, each document is indexed as a single PDF item.

## ZIP Files

You can also upload ZIP files containing multiple documents. The ZIP file will be extracted and each document will be indexed separately.

ZIP files can contain multiple different document types together, for example, a ZIP file could contain a PDF, a DOCX, and a TXT file.

Warning: Although ZIP files can contain multiple different document types, they cannot contain sub-folders.

## Loading Documents from a Server Path

In addition to Upload file and Web URL, you can use the Server path option to load a document that is already stored on the Squirro server, for example a file placed there by a scheduled export or one that resides on a mounted network share.

For security reasons, loading documents from a server path is turned off by default. A server administrator must first connect to the server, as described on the [Accessing Servers](../../../admin/operations/accessing-servers.md#admin-access) page.

Then, in the `[data_load]` section of the [common.ini](../../../admin/configuration/config-files/common-ini.md#admin-common-ini) file, located at `/etc/squirro/common.ini`, list the directories that Squirro is allowed to read from:

```ini
[data_load]
allowed_server_path_directories = /var/data,/opt/squirro/data
```

The value is a comma-separated list of absolute directory paths. Only files inside the listed directories, or inside their subdirectories, can be loaded. Symbolic links are resolved to their target, so a link that sits inside a listed directory but points to a file outside of it cannot be used.

The default value is empty, which turns off server path loading completely. As long as the setting is empty, or the requested file is outside of the listed directories, the data load fails.

A change to this setting takes effect only after all Squirro services are restarted. For the commands to do so, see the [Services](../../../admin/operations/services.md#admin-services) page.

Once the services have restarted, select Server path in the Document or ZIP file of documents field and enter the absolute path to the file, for example `/var/data/reports/q3-report.pdf`. The field takes a single path, and that path must point to a file rather than to a directory. To load several documents in one run, place them in a ZIP file and point to that file instead, as described in [ZIP Files](#zip-files).
