HTTP POST binary file to HTTP

Describe the problem/error/question

Hey ya’ll
Trying to post some mp3 files to a Whisper Asr server to do speech to text.
The mp3 files are the easy part, but having issues getting them to post to the webserver

Sending data outside of N8N results in success

curl -X 'POST' \
  'http://10.20.20.10:9000/asr?task=transcribe&language=en&encode=true&output=txt' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'audio_file=@rec_20230829-135446.mp3;type=audio/mpeg'

But am just a bit lost on how to achieve this using the HTTP node, as the audio file will be different everytime, following the same naming convention though

Please share your workflow

Appreciate any help :slight_smile:

Also as a side question, what would be the best way to go about only opening / sending files created in the last hour? have googled a bit but couldn’t find anything that used the file names to identify the time, or a way to ignore already matched mp3’s

Information on your n8n setup

  • n8n version: Latest
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):**Docker
  • **Operating system:**Unraid

Hi @FlippinTurt, it looks like you’re using an older version of the HTTP Request node that wouldn’t let you specify the field name for binary data (your curl request uses audio_file, but the node would use the default file value).

So you’d want to delete the old HTTP Request node and add a new one from scratch here, like so:

This would upload your audio file with the correct field name.

Also as a side question, what would be the best way to go about only opening / sending files created in the last hour? have googled a bit but couldn’t find anything that used the file names to identify the time, or a way to ignore already matched mp3’s

If you want to ignore already processed files perhaps you want to use the Local File Trigger node? You can use this to start a workflow for newly added files in a folder, meaning it should run only once for each file and you wouldn’t have to worry about deduplication.

3 Likes

It’s always the simple stuff, thank you so much for your help!

All working beautifully :slight_smile:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.