File content displays incorrectly in the viewer

Modified on Thu, 11 Dec, 2025 at 6:02 PM

Summary

This issue appears when Clockspring does not know the correct mime.type for a FlowFile. The UI falls back to a generic or unknown type, which causes JSON, XML, or text content to render incorrectly.

Symptom

When opening a FlowFile in the content viewer you see:

  • The viewer defaults to text or unknown

  • JSON appears as a single long line

  • The mime.type attribute shows unknown

  • The preview is not formatted as expected

Root Cause

One or more of the following is true:

  • The FlowFile has no mime.type attribute

  • The mime.type attribute contains the wrong value

  • The upstream processor did not set a content type

  • InvokeHTTP returned a response without a Content-Type header

  • The viewer uses its fallback mode because it cannot determine the format

How to Fix It

Option A: Set mime.type manually

If you know the content type:

  1. Add an UpdateAttribute processor

  2. Set mime.type to the correct value

    • application/json

    • text/csv

    • text/plain

    • application/xml

Option B: Use IdentifyMimeType

This processor analyzes the FlowFile content and sets mime.type automatically.

Use it when the content is a file, binary data, or text where the type is not provided.

Option C: Configure InvokeHTTP

For APIs this is usually the best fix.

Set Override Response Content-Type to the expected value.
Examples:

  • application/json

  • text/plain

  • application/xml

This ensures all responses carry the correct type, even if the API does not specify one.

Option D: Change the viewer mode manually

If you only need to fix the display once:

  • In the FlowFile content viewer, use the dropdown in the top right

  • Select json, xml, csv, or text as needed
    This does not update mime.type on the FlowFile. It only adjusts the display.

Prevention

  • Always set Override Response Content-Type on InvokeHTTP when calling APIs that return JSON

  • Use IdentifyMimeType early in flows where files may come from unknown sources

  • Standardize mime.type handling in your templates so content always renders correctly

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article