Convert "application/octet-stream" to PDF Setup

The Fix for MIME Type Errors

Are you dealing with a perfectly good PDF file that is throwing an application/octet-stream MIME type error and breaking your flow (especially when passing it to AI tools like Gemini)?

How to know for sure: Check the MIME type! If your file is supposed to be a PDF but your flow keeps failing, try adding a Log to history action to your flow and map the file's MIME type to it. If the log outputs application/octet-stream, this is exactly the case!

Instead of building the workaround from scratch, you can simply download this pre-built setup and paste it directly into your own flow!

What does this setup do?

This mini flow acts as a smart filter and converter to ensure your files always have the correct metadata. Here is the breakdown:

  • The Check: It uses an If Condition to check if your incoming file's MIME type is labeled as the generic application/octet-stream.

  • The True Branch (The Fix): If the file has the bad label, the flow converts it to Base64, reconverts it back to a file while forcing the correct application/pdf Content Type, and saves the corrected file into a File Variable.

  • The False Branch (The Pass-Through): If the file already has the correct PDF label, it simply saves the original file directly to that same File Variable.

  • The Result: Moving forward in your flow, you just map that File Variable to your subsequent actions. Whether the original email had a glitch or not, your flow will always proceed with a valid PDF!

How to use it:

  1. Download the mini flow using the link below.

  2. Import it into your Zenphi workspace.

  3. Copy the If Condition setup and paste it into your existing flow right after your trigger.

📥 Download the Mini Flow Here:

PDF mimetype Converter_1773335179681.json

Note: Want to know exactly why this error happens in the first place? Check out my full explanation post here:
#Facing issues with PDF processing? The issue might be the MIME type... Check this out!