Loading All the Files in a Directory
- Last Updated: April 14, 2026
- 1 minute read
- MarkLogic Server
- Version 12.0
- Documentation
Use the following procedure to load all the files in a native directory and its sub-directories. To load selected files, see Filtering Documents Loaded from a Directory.
-
Set
-input_file_pathto the input directory. -
Set
-input_file_typeif your input files are not documents. For example, if loading from delimited text files, sequence files, aggregate XML files, or database archives. -
Set
-document_typeif-input_file_typeis notdocumentsand the content type cannot be accurately deduced from the file suffixes as described in How mlcp Determines Document Type. -
Set
-mode: To perform the work locally, set-modetolocal.
By default, the imported documents have database URIs based on the input file path. For details, see Controlling Database URIs During Ingestion.
The following example command loads all the files in /space/bill/data:
# Windows users, see Modifying the Example Commands for Windows
$ mlcp.sh import -host localhost -port 8000 -username user \
-password password -input_file_path /space/bill/data