🛠️ Change Binary MimeType/Extension
Workflow preview
$20/month : Unlimited workflows
2500 executions/month
THE #1 IN WEB SCRAPING
Scrape any website without limits
HOSTINGER
Early Deal
DISCOUNT 20% Try free
DISCOUNT 20%
Self-hosted n8n
Unlimited workflows - from $4.99/mo
#1 hub for scraping, AI & automation
6000+ actors - $5 credits/mo
Important notice
This workflow is provided as-is. Please review and test before using in production.
Overview
How it works
This workflow changes the file name, and therefore the extension and MIME type, of any binary file passed to it. This is perfect for converting file formats on the fly, like turning a Telegram voice message (.oga) into an MP3 for an AI transcription service.
- Set New File Name: The
SET OUTPUT FILE NAMEnode is where you define the desired output file name and extension (e.g.,audio.mp3). It also dynamically captures the property name of the incoming binary (e.g.,data). - Extract Binary Data: The workflow temporarily converts the binary file into a Base64 text string to make it accessible in the next step.
- Rebuild Binary with New Name: A Code node takes the Base64 data and reconstructs it as a binary file, but this time, it assigns the new file name you specified. n8n automatically sets the MIME type based on the new file extension.
Set up steps
Setup time: < 1 minute
This workflow is designed to be used as a sub-workflow.
- In your main workflow, add an Execute Sub-Workflow node where you need to change a file's type.
- In the Workflow parameter, select this "Change Binary MimeType/Extension" workflow.
- Open this workflow and go to the
SET OUTPUT FILE NAMEnode. - Modify the
output_file_namevalue to your desired file name (e.g.,voice_message.mp3ordocument.pdf). - Save this workflow. Now, any binary file you send to it from your main workflow will be returned with the new fileName and mimeType.