vonpupp
1
I am trying to send a file via HTTP Request
I am new to n8n. I watched the first course and I am trying to send a file to an API.
I have a workflow where I download an audio message from slack using “{{ $json.url_private_download }}”.
I am able to download the file properly, however on the next step I want to send that file to my own API using whisper and FastAPI.
This curl works fine:
❯ curl --request POST --url 'http://com-haevas-hapi.example.com:8080' -F "file=@audio_2025-02-24_00-47-23.ogg" --verbose
Note: Unnecessary use of -X or --request, POST is already inferred.
* Host com-haevas-hapi.example.com:8080 was resolved.
* IPv6: (none)
* IPv4: 10.1.1.15
* Trying 10.1.1.15:8080...
* Connected to com-haevas-hapi.example.com (10.1.1.15) port 8080
* using HTTP/1.x
> POST / HTTP/1.1
> Host: com-haevas-hapi.example.com:8080
> User-Agent: curl/8.12.1
> Accept: */*
> Content-Length: 660686
> Content-Type: multipart/form-data; boundary=------------------------HRF9EEKf4VTbXm4GB0p4ji
>
* upload completely sent off: 660686 bytes
< HTTP/1.1 200 OK
< Content-Length: 343
< Content-Type: application/json
< Date: Thu, 27 Feb 2025 14:05:51 GMT
< Server: uvicorn
<
* Connection #0 to host com-haevas-hapi.example.com left intact
" <the transcript goes here>
Errors that I am getting
The item has no binary field ‘[object Object]’ [item 0]
The workflow
Could you please help me.
Thanks.
Information on your n8n setup
- n8n version:
- Database (default: SQLite): SQlite
- n8n EXECUTIONS_PROCESS setting (default: own, main): Default
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Linux
n8n
2
It looks like your topic is missing some important information. Could you provide the following if applicable.
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
Have you tried using data
as the input data field name?
For example this is how you should set it up:
The name of the field that you should use is indicated in the left (data).
vonpupp
5
Thank you for your help.
That is exactly what I thought it should be. When I do that, I get the following error message:
422 - "{\"detail\":[{\"type\":\"missing\",\"loc\":[\"body\",\"file\"],\"msg\":\"Field required\",\"input\":null}]}"
Which is the equivalent of using the same curl command above without the file. I get the exact same thing:
❯ curl --request POST --url 'http://com-haevas-hapi.example.com:8080' --verbose
* Host com-haevas-hapi.example.com:8080 was resolved.
* IPv6: (none)
* IPv4: 10.1.1.15
* Trying 10.1.1.15:8080...
* Connected to com-haevas-hapi.example.com (10.1.1.15) port 8080
* using HTTP/1.x
> POST / HTTP/1.1
> Host: com-haevas-hapi.example.com:8080
> User-Agent: curl/8.12.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 422 Unprocessable Entity
< Content-Length: 89
< Content-Type: application/json
< Date: Thu, 27 Feb 2025 15:32:11 GMT
< Server: uvicorn
<
* Connection #0 to host com-haevas-hapi.example.com left intact
{"detail":[{"type":"missing","loc":["body","file"],"msg":"Field required","input":null}]}
@vonpupp Did you try to import working curl to HTTP Request Node?
vonpupp
7
Thank you. Yes I tried that too.
I could fix it, apparently it was on the API, which isn’t mine to begin with.
1 Like
Can you share your workflow as JSON?
system
Closed
9
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.