Help needed: Uploading binary image from Photoroom to WooCommerce

Hi everyone,

I’m trying to upload an image generated by Photoroom to WooCommerce using n8n.
The problem is that Photoroom returns the image as binary data, but WooCommerce requires a URL for the image.

I’m stuck trying to figure out how to convert or host the binary image so that I can pass a valid URL to WooCommerce.

Any ideas or guidance would be really appreciated!

Thanks in advance :pray:

n8n Version
1.88.0
Source Code

The fragment below uploads binary files to https://tmpfiles.org/ and returns upload status and direct url. You need to replace binary_field_name in HTTP Request node appropriately. The file will be automatically removed after 60 minutes.

If this resolves your question, please mark this post as a :white_check_mark: Solution.

1 Like

Thank you so much for your help! :pray:

I’m now getting the following error when I try to do it this way:

{
“errorMessage”: “The service was not able to process your request”,
“errorDescription”: “Server Error”,
“errorDetails”: {
“rawErrorMessage”: [
“500 - "{\n \"message\": \"Server Error\"\n}"”
],
“httpCode”: “500”
},
“n8nDetails”: {
“nodeName”: “Upload to tmpfiles.org”,
“nodeType”: “n8n-nodes-base.httpRequest”,
“nodeVersion”: 4.2,
“itemIndex”: 0,
“time”: “22.4.2025, 13:21:25”,
“n8nVersion”: “1.88.0 (Cloud)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“NodeApiError: The service was not able to process your request”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:597:21)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:27)“,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:915:51”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1246:20"
]
}
}

instead of returning it as an image, it outputs it as a file (not in an image format)

You may need to fix the file name. Preferably in the node that form the binary entry. If not possible then try the following Code node.

1 Like

What is “it” exactly in “it outputs”?

Thanks again for the quick reply – the code you shared fixed the issue! :raised_hands:
I’m still facing one problem though: it doesn’t accept the URL.

Please mark my post above as a :white_check_mark: Solution.
I’d recommed to start a different topic for this another issue, to not confuse the future readers.

1 Like

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