Microsoft OneDrive Node does not obey the filename property

Describe the problem/error/question

I am using Microsoft OneDrive, and set to read binary data. What I see it takes the filename from binary data and ignores what I am setting at the File Name field.

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.21.1
  • Database (default: SQLite): Percona
  • n8n EXECUTIONS_PROCESS setting (default: own, main): queue
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system:

Hey @Martin_Neumann,

Looking at the node it looks like we use the filename as an overwrite option if there is no name already. I will make a note to get this changed at some point.

So the filename is used when I am sending JSON data to the node, or there is not filename defined in the data stream? Yes I think it would be more logical to use the filename defined in the node, and just fall back to the data stream filename if there is none defined in the node. That would allow for an easier overwrite of the filename. That would probably apply to many other nodes the same.

1 Like

Hey @Martin_Neumann,

Yeah that would make sense, I need to check the API though as I am not sure if the OneDrive API allows renaming on the upload so there could be a little bit more work to do on this.

Maybe you write a routine that swaps out the filename in the input data in case it is defined, and you use it in all of your nodes that are writing files to some cloud storage.

Hey @Martin_Neumann,

That is not a bad idea, I think some APIs just handle it though without the need to change anything. Until I look into what is supported it is hard to say which approach will be taken.