NiFi Ingest 25.2
NiFi Ingest

# Remove Temporary Files

The ingestion process generates temporary files. Connectors can download files from a repository. File Content Extraction writes extracted subfiles to a temporary storage area. It can be useful to keep these files, for example so that you can troubleshoot problems while developing the pipeline, but usually they should be deleted when processing is complete.

If you examine a NiFi FlowFile that originated from an connector (and it is not a metadata-only document), you will see one of the following document parts:

- `contentfile` - contains binary file content.
- `contentfilename` - the path to a file on disk. The file might, or might not, be owned by NiFi.

For example, if you use a File System Connector there will be a FlowFile for each file that is retrieved from the file system. Depending on how you configure the connector, each FlowFile will contain either the binary content of the associated file or a path to the file on disk.

When you delete a `contentfilename` document part and the associated file is owned by NiFi, the file is automatically deleted. This section describes how to remove file references from FlowFiles before the documents are indexed, so that temporary files are deleted.

To remove temporary files

1. Add a RemoveDocumentPart processor to the canvas.

2. Create a connection between the StandardizeMetadata processor and the RemoveDocumentPart processor. Hover the mouse over the StandardizeMetadata processor until you see the connection icon - - and then drag the icon to the RemoveDocumentPart processor.

   The Create Connection dialog box opens.

3. In the Relationships area, select the success check box and then click ADD.

   The connection appears on the canvas and NiFi automatically adds the queue between the processors.

4. Right-click the RemoveDocumentPart processor and click Configure.

   The Configure Processor dialog box opens.

5. Click the Properties tab.

6. In the properties list, ensure that the properties have the following values:

   Remove document content parts | False | (keep the document content so that it can be indexed)
   Remove document contentfile parts | True | (to remove binary content from the FlowFile)
   Remove document contentfilename parts | True | (to remove file references and allow NiFi to delete temporary files)
   Remove document xmlmetadata parts | False | (keep the document metadata so that it can be indexed)

7. Click Apply.

Copyright 2018-2025 Open Text
Version 25.2 | Last updated April 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery NiFi Ingest 25.2

Topic Title: Remove Temporary Files