# Struggling to turn a curl command with file upload to node red flow

**URL:** https://discourse.nodered.org/t/struggling-to-turn-a-curl-command-with-file-upload-to-node-red-flow/72041
**Category:** General
**Created:** [11 December 2022 17:06 UTC](https://discourse.nodered.org/t/struggling-to-turn-a-curl-command-with-file-upload-to-node-red-flow/72041 "2022-12-11T17:06:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pete](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pete/32/60896_2.png) [@pete](https://discourse.nodered.org/u/pete)
#### Post date: [11 December 2022 17:06 UTC](https://discourse.nodered.org/t/struggling-to-turn-a-curl-command-with-file-upload-to-node-red-flow/72041/1 "2022-12-11T17:06:33Z")

</div>

```auto
curl -X 'POST' \
  'http://localhost:9000/asr?task=transcribe&output=json' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'audio_file=@signal-2022-12-11-160613.ogg;type=video/ogg'

```

How can I turn this into a node red flow using the http request node? The file can come from a file node.  
Just putting the binary buffer in payload does not solve the issue and in the response message it says that field audio\_file is missing.

So I guess I somehow have to tell the http request node that this binary buffer from the file node is "audio\_file"

My Use Case: I'm trying to get a transcription for an audio file via a whisper web service: [GitHub - ahmetoner/whisper-asr-webservice: OpenAI Whisper ASR Webservice API](https://github.com/ahmetoner/whisper-asr-webservice/)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 December 2022 20:17 UTC](https://discourse.nodered.org/t/struggling-to-turn-a-curl-command-with-file-upload-to-node-red-flow/72041/2 "2022-12-11T20:17:12Z")

</div>

Have you searched the forum? It has been covered many times.

This answer is a good example...

> [@Posting PDF-files multipart/form-data solution](https://discourse.nodered.org/t/posting-pdf-files-multipart-form-data-solution/58914/4):
>
> The help sidebar for the HTTP Request node tells you how to do a file upload. File Upload To perform a file upload, msg.headers["content-type"] should be set to multipart/form-data and the msg.payload passed to the node must be an object with the following structure: { "KEY": { "value": FILE\_CONTENTS, "options": { "filename": "FILENAME" } } } The values of KEY , FILE\_CONTENTS and FILENAME should be set to the appropriate values.

---

<div class="post-metadata">

### Author: ![pete](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pete/32/60896_2.png) [@pete](https://discourse.nodered.org/u/pete)
#### Post date: [12 December 2022 10:12 UTC](https://discourse.nodered.org/t/struggling-to-turn-a-curl-command-with-file-upload-to-node-red-flow/72041/3 "2022-12-12T10:12:00Z")

</div>

Hi,

thank you, I found other topics but the solution didn't work (they were splitting the message in multipart headers manually). Your solution from the pdf file works.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [26 December 2022 10:12 UTC](https://discourse.nodered.org/t/struggling-to-turn-a-curl-command-with-file-upload-to-node-red-flow/72041/4 "2022-12-26T10:12:32Z")

</div>

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