File upload via the new HTTP node doesn't seem to work

Describe the issue/error/question

When trying to upload a file to multiple file hosting sites (tmpfiles.org , file.io), the workflow errors out.
The same requests work just fine when implemented from Postman.

What is the error message (if any)?

{ "message": "Server Error" }

Please share the workflow

This is the equivalent CURL command:
curl -F "[email protected]/Users/myuser/test.jpg" https://tmpfiles.org/api/v1/upload

as given here: /tmp/files - API

Information on your n8n setup

  • n8n version: 0.196.0
  • Database you’re using (default: SQLite): Postgres
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: docker

That does seem broken using either form data or n8n binary. For now you can get the old version by copy/pasting an existing HTTP node, or pasting this onto your canvas

The error looks like it’s trying to send the raw JS buffer -

{
    "status": "rejected",
    "reason": {
        "message": "500 - {\"type\":\"Buffer\",\"data\":[123,10,32,32,32,32,34,109,101,115,115,97,103,101,34,58,32,34,83,101,114,118,101,114,32,69,114,114,111,114,34,10,125]}",
        "name": "Error",
        "stack": "Error: Request failed with status code 500\n    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:525:35)\n    at IncomingMessage.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1358:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)"
    }
}

That is a bit strange, Doing the same test but sending it to webhook.site seems to result in a file being sent.

I have given the same workflow a test using the old HTTP Request node and I hit the same issue so I don’t think it is directly related to the node and could be something else.

@shrey-42 @pemontto I tried on postman and it does not work either. It seems to be an issue with the tmpfiles.org

Just tried with another side for uploading temporary files and worked just fine.

https://tmp.ninja/upload.php

For me, it’s working just fine in Postman though. But not in n8n.

@shrey-42 does it work with an older version of n8n or the v2 http request node? I couldn’t get it working with v2 or v3 so I would like to rule out this possibly being related to the node itself. I have also managed to upload data to other services this morning.

@Jon nope, so far i haven’t been able to get it working in n8n in any way (versions of n8n/http or even directly axios via function node)

I couldn’t get it to work with any version of the HTTP node. The site definitely works with curl:

curl -L -o test.jpg https://picsum.photos/1200/800
curl -F "f[email protected]" https://tmpfiles.org/api/v1/upload

I had the same issue, The good news there though is we know it is not related to the new HTTP node so we don’t need to go through the changes.

This one does not work for me in cURL nor in postman.

This one works everywhere. Postman, n8n and cURL.

@shrey-42 Can you share a recording of this working? I have not been able to get it working with anything. I tried Postman, cURL, and n8n.

Postman:

CURL:


Note: there were some security issues with the command which were then bypassed using -k

Downloading the test.jpg from picsum.photos file before uploading to tmpfiles.org:

n8n-http

https://tmpfiles.org/102604/test.jpg