Upload binary image to Ghost AdminAPI from n8n fails

I want to upload a binary image to the Ghost Admin API from a workflow engine (n8n) but that fails.

image

As stated in the docs (Ghost Admin API Documentation) the upload expects the file as Blobor Filebut imho thats the case, even when I don’t use a physical file, instead a use the direct binary data.

Actually I get this error:

ERROR: Your request is invalid or could not be processed by the service
415 - “{"errors":[{"message":"Please select a valid image.","context":null,"type":"UnsupportedMediaTypeError","details":null,"property":null,"help":null,"code":null,"id":"382764a0-827e-11ee-892a-db6acb4b0f68","ghostErrorCode":null}]}” - {“errors”:[{“message”:“Please select a valid image.”,“context”:null,“type”:“UnsupportedMediaTypeError”,“details”:null,“property”:null,“help”:null,“code”:null,“id”:“382764a0-827e-11ee-892a-db6acb4b0f68”,“ghostErrorCode”:null}]}

IMHO the request looks good. I already tested it with a webhook test site and that was the result:
(3) Webhook.site - Test, process and transform emails and HTTP requests

What am I missing?

n8n setup:

  • n8n version: Version 1.15.2
  • Database (default: SQLite): MySQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): not changed
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Unraid

ghost setup:

Running as docker

Screenshot 2023-11-14 at 11.28.09

You’re missing the file (the file/blob) form data property.

1 Like

Thank you! I discovered that I need to invoke my generating request with filename.extension at the end in the address. Than everything works perfectly. Nothing which is a problem at ghost side. Sorry for bothering :)