Skip to main content

Hi all – I’m running into an issue where my Zap attempts to upload email attachments (specifically PDFs) from Gmail, filter them using MIME type in a code step, and pass only the valid PDFs into the “Upload File” and “Conversation” steps for ChatGPT.

Here’s what’s happening:

  • I correctly isolate PDFs via MIME type using a JavaScript step.

  • The filtered file URLs are then passed to several “Upload File to OpenAI” steps using the “assistants” purpose.

  • The upload appears successful — the PDF shows as Ready in the OpenAI file list with the correct file- ID.

  • However, when I try to pass those uploaded file IDs into a “Create Conversation in ChatGPT” step, I receive the error:

    “Non-PDF files (downloaded_file.txt…) require Code Interpreter to be enabled…”

  • I’ve confirmed that the files I’m passing are valid PDFs, not text files — but downloaded_file.txt files keep appearing in my OpenAI storage.

  • My assumption is Zapier is somehow uploading blank or non-PDF files behind the scenes, even though I’ve filtered for MIME type.

Would appreciate any help — I’m trying to reliably extract PDF attachments from Gmail and feed them into ChatGPT for summarization, and this issue is holding up the workflow.

 

Thanks in advance!

Hi ​@lwhathaway 

Help us have true context by posting screenshots showing:

  • how your Zap steps are outlined
  • how your Zap steps are configured in EDIT mode in the CONFIGURE tab with the field mappings visible
  • any encountered errors from testing Zap steps

The downloaded_file.txt issue happens because Zapier sometimes sends a text wrapper instead of the actual PDF binary when pulling Gmail attachments. Even if you filter by MIME type, Gmail often just gives Zapier a link or base64 data, so the OpenAI Upload step treats it as text. The fix is to normalize the file before upload: either use Zapier’s “Formatter Utilities → File” step on the Gmail attachment, or in your Code step explicitly return the file with .pdf as filename and application/pdf as MIME type. That way the OpenAI step sees a true PDF and won’t generate .txt placeholders.


Reply