Hi, I fetch an email attachment from an imap server (that works) and I want to upload it to my cloud storage (the connection works) - but when I do so I returns this error:
ERROR: Request failed with status code 400
Details
Time
21.8.2023, 15:05:41
HTTP Code
400
Stack
NodeApiError: Request failed with status code 400
at RoutingNode.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:114:23)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:686:23)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:631:53
No I havenât - I solved it now this way:
{{ DateTime.now().toString() +â.txtâ }}
But yeah I think you are right, the problem is the space - now after Googleing Naming convention I found this:
What is the naming convention for Cloud Storage?
Bucket names. Your bucket names must meet the following requirements: Bucket names can only contain lowercase letters, numeric characters, dashes ( - ), underscores ( _ ), and dots ( . ). Spaces are not allowed.
Nope now it doesnât work anymore âŚ^^ unbelievable. It worked with 1.1 and now with 1.3.1 this morning not anymore:
This works:
fixed.txt
{{ âfixed.txtâ}}
but none combination with Date.now - even Date.now()+ââ which just returns a number doesnât work and it worked for sure yesterday night
So this also works:
{{ $json.metadata[âx-exclaimerimprintlatencyâ] }}.txt
but $now+â.txtâ or DateTime.now()+".txt doesnât so I really think that is a bug with 1.3.1 maybe the DateTime.now() Function gets a space added in the request or it transforms it in some ways
This also fails: {{ Math.round(Math.random()*100) }}
in short it seems all functions fails
@Jon (added you - I wasnât sure you get the replies when I donât mention you)
Yes a 400 - and thatâs really a problem now because the files I received as well as the email are always the same subject name etc. So I need some kind of randomness in the filename for the bucket or I overwrite them. timestamp would be ok as well as a random number
Thank you I found a workaround for now - I add a code node inbetween and adde a field âfileNameâ to the json based on the timestamp and use this field in the cloud storage node as filename. that works again.
Hey!
This doesnât work â {{ "rsj_" + $now.toMillis() + "." + $input.item.binary.data.fileExtension }}
This also doesnât work â rsj_{{ $now.toMillis() }}.{{ $input.item.binary.data.fileExtension }}.
This works â {{ $input.item.binary.data.fileName }}
I cannot replicate it quickly now, but in another workflow, this works â {{ $node.setBody.json.filename }}.pdf (I know it is not the same, but I need to leave the screen now ) Hope it helps.
H.