HttpRequest POST with file upload

Describe the problem/error/question

I’m trying to send an http post request with a file.
In essence, I’m trying to convert the following curl to n8n:

curl --location --request POST 'https://ff-data-importer.example.com/autoupload?secret=xxxxxx' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJxxxxxx \
--form 'json=@"file.json"'

This is what I have on n8n:

I am getting the file from Nextcloud (comes from another node).

What is the error message (if any)?

The service refused the connection - perhaps it is offline

However, the curl command works well.

Can someone help me with this?
Thank you!

Information on your n8n setup

  • n8n version: 1.75.2
  • Database (default: SQLite): PostGres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux

Hey @ZXS , try n8n Binary File instead.

How do you define the property name that way?

Gives the same error :frowning:

For more context, I’m trying to send a config file to Firefly, using gocardless. Here are de docs: How to import using POST - Firefly III documentation

Not sure what I am doing wrong. I even managed to create a small nodejs script that does this successfully.

I checked your configuration with https://webhook.site and it works fine. There is something peculiar with the API you upload to that rejects the POST request from n8n.

I have only one suggestion left to try. Replace the Athorization header with Header authentication creds. That is, create the generic creds Header Auth and use that for authentication removing the corresponding header in the node configuration.

Thank you very much for your time and suggestions.
Unfortunately it did not work. I could not make this happen. I believe that API is not working as expected, so I abandoned this.

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