Hi, first thanks for reading my issue :).
I’ve got something weird when I try to upload a file to OneDrive (business), I’ve got a developers tenant where I do my experiments.
I’m running the default docker image: docker.n8n.io/n8nio/n8n.
Behind an apache reverse proxy.
When uploading a file to a specified directory (n8n) in the root of the drive, I expect to get
for example /n8n/filename.txt. But instead I’m getting the content type written out in a directory/filename. For example I’m trying to upload “n8n test file.txt” so I expect to find “/n8n/n8n test file.txt”. But instead I get: “/n8n/text/plain” as seen below in the screenshot.
Addition, off course I forget to attach my post to the webhook :).
Hi @GKdeVries, welcome to the community and sorry for the trouble!
I was able to reproduce this problem, the filename set in the node appears to be ignored for uploads to OneDrive business. There seem to be additional problems with the way n8n handles plain/text files for incoming webhooks as well and I shall add this to our bug tracker for a fix.
I’ll fiddle around with this some more and see if I can come up with a workaround in the meantime.
Okay, so file handling seems to work fine for files other than plain/text files. Were you just using this text file for testing and will be sending other file types to n8n going forward?
If so and seeing you are providing the filename in a query parameter filename, you can get this to work by simply renaming your file before sending it to the OneDrive node. Like so:
But looking into this with fresh eyes, I would say it is already going wrong at the first step (webhook).
Since it`s putting the using the content-type as an filename instead of the original filename as shown in the screenshot below. This will indeed create the weird path, since the filename is a path :).
Off course we can remedy this with your example with the addition of a code node (nicely done :)) or my first work-around for this as shown below.
But I would say the webhook is at fault since the given filename is incorrect since it`s using the content-type as the filename.
That`s indeed weird the result of the textfile in onedrive is empty. I’ve also tried a couple of other files (jpg, xml, json, xls) but these look fine.